- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] Moving an object by keyboard
Tagged: 64_bits, keyboard, python, SOFA_other, Windows_10
Hi!
I want to move on object in the scene, but I don’t know how can I do it.
A try the python exampe ‘keyboardControl’ in the SofaPython library, but it doesn’t work. I press the Ctrl key also, but the object doesn’t move.
I read an topic about moving a scissor parts, and I try to modify that script, but it didn’t work also. It is like, that Sofa can’t sense the key pressing.
I want to move an instrument start point by this way.
Can anyone help me?
Thanks!
Bence
Hey @bence
Your first idea of looking in the ‘keyboardControl’ example of the SofaPython plugin was very good!
Are you sure to have SofaPython compiled on your machine?
Can you tell me what happens (console output) when you run this example?
Nothing happens when using ctrl+keys (from directional keyboard)?
Hugo
Hi!
I solved the problem. The keyboardControl.py was wrong, it use incorrect variable (free_position instead of position). When I change it, it worked!
Bence
Nice !
I will mark the topic as solved, congrats!
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.