@@ -39,6 +39,10 @@ def onKeypressedEvent(self, event):
3939
4040 if ord (key ) == 20 : # right
4141 print ("You pressed the Right key" )
42+
43+ if key == 'M' : # M key of the keyboard
44+ print ("You pressed the M key" )
45+
4246
4347 def onKeyreleasedEvent (self , event ):
4448 key = event ['key' ]
@@ -54,6 +58,10 @@ def onKeyreleasedEvent(self, event):
5458 if ord (key ) == 20 : # right
5559 print ("You released the Right key" )
5660
61+ if key == 'M' : # M key of the keyboard
62+ print ("You released the M key" )
63+
64+
5765 def onMouseEvent (self , event ):
5866 if (event ['State' ]== 0 ): # mouse moving
5967 print ("Mouse is moving (x,y) = " + str (event ['mouseX' ])+ " , " + str (event ['mouseY' ]))
@@ -96,13 +104,13 @@ def createScene(root):
96104def main ():
97105 import SofaRuntime
98106 import Sofa .Gui
99- import SofaQt
107+ SofaRuntime . importPlugin ( "SofaImGui" )
100108
101109 root = Sofa .Core .Node ("root" )
102110 createScene (root )
103111 Sofa .Simulation .initRoot (root )
104112
105- Sofa .Gui .GUIManager .Init ("myscene" , "qglviewer " )
113+ Sofa .Gui .GUIManager .Init ("myscene" , "imgui " )
106114 Sofa .Gui .GUIManager .createGUI (root , __file__ )
107115 Sofa .Gui .GUIManager .SetDimension (1080 , 1080 )
108116 Sofa .Gui .GUIManager .MainLoop (root )
0 commit comments