openleap / PyLeapMouse

A Leap Motion based mouse in Python
Other
171 stars 66 forks source link

enable to do commands with motions #19

Closed GCorbel closed 10 years ago

GCorbel commented 11 years ago

I created to the possibilty to bind gestures and commands. You must to add a file named commands.ini at the root of the folder. If we run the code like this python PyLeapMouse.py --motion.

The code is probably not perfect, I'm not a Python developer. Please, let me know if you whant to change something.

Motions are imprecise. Some movement are detected when there is nothing. This problem is due to leap motion. If you have a technic to be more precise, again, let me know.

This is an example of a commands.ini file.

[screentap]

[keytap]

[swiperight]
1finger: rhythmbox-client --next
2finger: rhythmbox-client --next
3finger: rhythmbox-client --next
4finger: rhythmbox-client --next
5finger: rhythmbox-client --next

[swipeleft]
1finger: rhythmbox-client --previous
2finger: rhythmbox-client --previous
3finger: rhythmbox-client --previous
4finger: rhythmbox-client --previous
5finger: rhythmbox-client --previous

[clockwise]
1finger: rhythmbox-client --play
2finger: rhythmbox-client --play
3finger: rhythmbox-client --play
4finger: rhythmbox-client --play
5finger: rhythmbox-client --play

[counterclockwise]
1finger: rhythmbox-client --pause
2finger: rhythmbox-client --pause
3finger: rhythmbox-client --pause
4finger: rhythmbox-client --pause
5finger: rhythmbox-client --pause
wyager commented 10 years ago

I like this, but we need some documentation before merging. If you want to edit the README and add some comments to the code, I will definitely merge.