leapmouse icon indicating copy to clipboard operation
leapmouse copied to clipboard

Bind gestures with shortcuts and commands

Open GCorbel opened this issue 12 years ago • 26 comments

Hi,

I think the mouse is not realy useable because it's very unprecise. It's hard to click on the little X to close an app.

I think it can be a good idea to not bind leap and mouse, by default, the finger move the scrollbar.

It can bind good to bind gestures with keyboard's shortcut or with commands. Every commands and shortcuts should be customizable with a simple file.

What you think?

GCorbel avatar Sep 04 '13 10:09 GCorbel

Hi Thank for your contribution!!

Yes, in fact this first release is a starting point. Now I am studying the libraries fann, (Fast artificial neural network),to add them in a class for gesture recognition. The idea of ​​using the shortcuts for some commands is very useful and it would be nice to configure them. If you can help me be of interest in the project would be very nice.

If you agree i enter your name and email list authors of the project .. ?

Thank you very much!

archetipo avatar Sep 04 '13 11:09 archetipo

If I understand as well, fann enable to be more precise and to have a better recognition of gestures, right?

I'm intersted to contribute to this project. I'm not a C developer (I am a Ruby developer). I need to do some search. I already map the circle with the caps lock key (totaly useless). I will try to do more.

I agree to be in the list of authors.

GCorbel avatar Sep 04 '13 12:09 GCorbel

No problem if you aren't a C++ developper , there is no rush!! : ) fann enable to learning the gesture. the next step is connect gesture and action, the good way to do this, is create a class for aciotion manager and a class for action shooter ,that implement few action. The AI class after learning, can intepretate the gesture and call the appropritate action ,trough action manager . Now i stay working on AI class, for gesture recognition, and hope it work!! :D

your contact as been added in AUTHORS file.

Thanks a lot

2013/9/4 Guriec Corbel [email protected]

If I understand as well, fann enable to be more precise and to have a better recognition of gestures, right?

I'm intersted to contribute to this project. I'm not a C developer (I am a Ruby developer). I need to do some search. I already map the circle with the caps lock key (totaly useless). I will try to do more.

I agree to be in the list of authors.

— Reply to this email directly or view it on GitHubhttps://github.com/archetipo/leapmouse/issues/3#issuecomment-23784978 .

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 http://www.thinkstudio.itwww.thinkstudio.it

archetipo avatar Sep 04 '13 12:09 archetipo

So, Leap with fann will be able to have other gestures, like exclamation mark for example. That's it? Do you plan to do it in another project? It can be useful to every leap applications. Nice project!

What you think about using a library like QT? It add a big dependency but it will be a lot simple to develop.

GCorbel avatar Sep 04 '13 12:09 GCorbel

What you think about using this : https://github.com/SavinaRoja/PyUserInput. The advantages I see are :

  • It's cross plateform;
  • It's more modern language;
  • It's easier;

There is a SDK for Fann and Leap in python. So, there is a no compatibility problem with librairies.

GCorbel avatar Sep 04 '13 13:09 GCorbel

Hi!

Thank tor all!

So i ha ve tried to develop the mouse controller in python first to do IT in c++ , bat i had some problem with a PyMouse module , have you tried it? this module in ubuntu isn't able to focused other windows beyond the foreground window, and this is a ill, i have tried also to hack the pymouse and later I chose the way of c++,because have best and direct integration with X11. About the the Gui , is not a bad idea to insert it ,to manage some behavior of the application, like, customization connection between gesture and action for example.. But for this, thought to use a cocod2d-x library you know? http://www.cocos2d-x.org/

what do you say? Ciao Alessio

On Wednesday, September 4, 2013, Guriec Corbel [email protected] wrote:

What you think about using this : https://github.com/SavinaRoja/PyUserInput. The advantages I see are :

It's cross plateform; It's more modern language; It's easier;

There is a SDK for Fann and Leap in python. So, there is a no compatibility problem with librairies.

— Reply to this email directly or view it on GitHub.< https://github.com/notifications/beacon/f1PFuYtP6wl87Jw1_q8V8yYwFVz9uqLHA4MzhO1ckeN2uQbXY4S8jsP5_Rc8Fubq.gif>

archetipo avatar Sep 05 '13 09:09 archetipo

Hi,

(I forgot to click on "Comment" to send a message this morning).

I did the same project with py : https://github.com/GCorbel/PyLeapMouse. It detect motions and execute commands in the config.ini file. I probably should do a lot of refactoring (I must to learn Python) but it works.

To bind keyboard or mouse, it's possible to use xdotool. It can be useful to send some variables to command lines. Their is a lot of work to do.

I don't know if it's better to use C or Python but it take half lines of code. Python is a more recent language.

What you think?

GCorbel avatar Sep 05 '13 23:09 GCorbel

Hi , very nice job !! This command the rhythmbox,I don't know xdotool and now i study it. Python is a scripting language, swapped from C, in fact many libraries that use in python ,first is written in C and later with Cython creates a python wrapper . (talk about non pure python libraries e.g look Skype4py library). This procedure often detemines a loss of functionality of the libraries, because all the method property and structure ( read e.g. a leap, c++ code book and the python code book, you look that in c++ there are some methods more than python) are imported one by one ,and in this stage , few part of code are lost o don't work very well especially when working in a low level call , like X11, this behavior is much more evident.

have a nice day!!

2013/9/6 Guriec Corbel [email protected]

Hi,

(I forgot to click on "Comment" to send a message this morning).

I did the same project with py : https://github.com/GCorbel/PyLeapMouse. It detect motions and execute commands in the config.ini file. I probably should do a lot of refactoring (I must to learn Python) but it works.

To bind keyboard or mouse, it's possible to use xdotool. It can be useful to send some variables to command lines. Their is a lot of work to do.

I don't know if it's better to use C or Python but it take half lines of code. Python is a more recent language.

What you think?

— Reply to this email directly or view it on GitHubhttps://github.com/archetipo/leapmouse/issues/3#issuecomment-23909062 .

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 www.thinkstudio.it

archetipo avatar Sep 06 '13 10:09 archetipo

Hi,

It actualy command Ryhtmbox but it's easy to change the commands called. The use can edit this file : https://github.com/GCorbel/PyLeapMouse/blob/master/config.ini. This file should probably be in the home folder later. It is possible to do something like this :

clockwise: xdotool key alt+tab
...

We can enable add variable and use it like this :

move: mousemove %{x_on_screen} %{y_on_screen} 
//or...
move: rhythmbox %{x_in_percentage}

It's also possible to add a different binding with one, two, three... fingers.

Every interecation can be externalized to xdotool. I tried it and it works. We can assume than this tool works. If we decide to use it, the user is free to choose what our tool do and we doesn't have any problems with librairies. In addition, our tool is not dependent of X11. It will be probably useable with windows or mac.

GCorbel avatar Sep 06 '13 11:09 GCorbel

well!!

i'm very happy if i can cotruibuite to develop it... have you committed integration with xdotool? yep i have seen taht the config.ini is able to determinate the application to control, in this case implement a Gui widget for configure the app and the gesture to control it, is basic.

2013/9/6 Guriec Corbel [email protected]

Hi,

It actualy command Ryhtmbox but it's easy to change the commands called. The use can edit this file : https://github.com/GCorbel/PyLeapMouse/blob/master/config.ini. This file should probably be in the home folder later. It is possible to do something like this :

clockwise: xdotool key alt+tab ...

We can enable add variable and use it like this :

move: mousemove %{x_on_screen} %{y_on_screen} //or... move: rhythmbox %{x_in_percentage}

It's also possible to add a different binding with one, two, three... fingers.

Every interecation can be externalized to xdotool. I tried it and it works. We can assume than this tool works. If we decide to use it, the user is free to choose what our tool do and we doesn't have any problems with librairies. In addition, our tool is not dependent of X11. It will be probably useable with windows or mac.

— Reply to this email directly or view it on GitHubhttps://github.com/archetipo/leapmouse/issues/3#issuecomment-23934727 .

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 www.thinkstudio.it

archetipo avatar Sep 06 '13 12:09 archetipo

I've not commited integration with xdotool yet but I think it will be easy. I think the next step is to do a refactoring. There is too many 'if' and the main function is too long for my taste. I will do integration with xdotool later.

To do a gui is definitivly a good idea.

The most important is to be agree with one way. I think we must to decide a way to go. Which is better C or Python...

GCorbel avatar Sep 06 '13 13:09 GCorbel

I think is a good Idea write two type of app one in c and one in python, and decide in priority to complite the python for cross platforn and later complite c . the python app is good to complite in your repository and later i fork it. what do you say?

2013/9/6 Guriec Corbel [email protected]

I've not commited integration with xdotool yet but I think it will be easy. I think the next step is to do a refactoring. There is too many 'if' and the main function is too long for my taste. I will do integration with xdotool later.

To do a gui is definitivly a good idea.

The most important is to be agree with one way. I think we must to decide a way to go. Which is better C or Python...

— Reply to this email directly or view it on GitHub.< https://github.com/notifications/beacon/f1PFuYtP6wl87Jw1_q8V8yYwFVz9uqLHA4MzhO1ckeN2uQbXY4S8jsP5_Rc8Fubq.gif

< http://sgmail.github.com/wf/open?upn=hpYYt3Y9fsxPU5vkUvHQaJndNBGgvq6TmqeaVY2Q7IvTY1xBuJVI5h-2FV4y5f26MbUgSdWXK2hEr-2BDMnR0Xln7igocewfLJDKnnHGckLuByzEPxm-2F6UWHHHheTPpzMeNR6F-2B5BWc1cZCuCvrA5XWCeG9spCVCGbRh7FoFo2D-2BSIgmzVg6y5Qd2kayPRvgx4bpXGYeP6KJn66w3ch8kyNXcA-3D-3D

Best Regards Alessio Gerace

Think Studio +39 3396911693 www.thinkstudio.it

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 www.thinkstudio.it

archetipo avatar Sep 08 '13 10:09 archetipo

Good idea!

I worked on the Python app. It works but... I'm not very happy. There is a lack of precision. Check the .ini file. Different actions are bind with different motion and it depend of the number of fingers detected. The problem is than sometimes, 2 fingers are detected while there is only one, a circle is detected when I do nothing, swipe actions are hard to do, move the mouse is very very hard and to click on a button with precision is impossible, etc...

I submit a post here with no response. Do you have an idea?

GCorbel avatar Sep 08 '13 10:09 GCorbel

Hi, the problem is taht, Leap have 3 type of lib, one for linux, one for mac and one for win. the linux library is the least updated of all ... the problem you speak of is exactly one other reason why I developed the leapmouse in c. As I said not all methods are wrapped from C to python and this leads to a loss of accuracy .. I love python, but if libreire are poorly written, of course, works badly. have a good day

2013/9/8 Guriec Corbel [email protected]

Good idea!

I worked on the Python app. It works but... I'm not very happy. There is a lack of precision. Check the .ini filehttps://github.com/GCorbel/PyLeapMouse/blob/master/config.ini. Different actions are bind with different motion and it depend of the number of fingers detected. The problem is than sometimes, 2 fingers are detected while there is only one, a circle is detected when I do nothing, swipe actions are hard to do, move the mouse is very very hard and to click on a button with precision is impossible, etc...

I submit a post herehttps://developer.leapmotion.com/forums/forums/projects-and-collaborations/topics/a-way-to-have-a-more-precise-gesture-recognitionwith no response. Do you have an idea?

— Reply to this email directly or view it on GitHubhttps://github.com/archetipo/leapmouse/issues/3#issuecomment-24018490 .

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 www.thinkstudio.it

archetipo avatar Sep 09 '13 07:09 archetipo

hmmm... So you think than it will be more precise if we use C over Python. I will test it.

GCorbel avatar Sep 09 '13 07:09 GCorbel

I began my tests but I didn't finished it yet. I submited a post on the leap's forum and I received a great anwser. I will continue my tests tomorrow.

GCorbel avatar Sep 10 '13 01:09 GCorbel

thanks,

now I am working on neural network recognition for leap gesture... As soon as I prepared the first test commit them..

2013/9/10 Guriec Corbel [email protected]

I began my tests but I didn't finished it yet. I submited a post on the leap's forum and I received a great anwserhttps://developer.leapmotion.com/forums/forums/general-discussion/topics/is-there-a-difference-of-precision-between-language-and-sdk-versions. I will continue my tests tomorrow.

— Reply to this email directly or view it on GitHubhttps://github.com/archetipo/leapmouse/issues/3#issuecomment-24127097 .

Best Regards Alessio Gerace

  • Think Studio* +39 3396911693 www.thinkstudio.it

archetipo avatar Sep 10 '13 08:09 archetipo

I continued my tests an I didn't see any difference between. I think we have all keys to choose between C++ and Python.

This is the pros for python :

  • Python is a more advanced language;

And for C++ :

  • we can talk with the base and not a derived;
  • C is faster and closer to the machine;
  • we don't have big dependecy to install (the python language);

In my opinion, C++ is a better language for this project.

For xdotool :

  • we can use it as I did and put the commands called in a config file with variable;
  • we can include the xdotool source code available here;
  • we can use the X11 library like you did;

I think I prefer the first option because we are not fixed to X11 and we can do a cross plateform tool.

What you think?

GCorbel avatar Sep 10 '13 11:09 GCorbel

Has you seen this project? It seems to be similar to what you want to do.

GCorbel avatar Sep 10 '13 13:09 GCorbel

There is also this project. It doesn't works for linux but it do the samething we want to do. Is it realy useful to continue the project if there is already an existing one?

GCorbel avatar Sep 10 '13 17:09 GCorbel

I'd say go with C/++, as it doesn't require Python install (although I believe that's fairly common to be installed by default on linux systems).

Additionally, I'm having some fun here and I have no intention of learning Python atm (and I wanted a C++ project to work on).

JeffBobbo avatar Sep 10 '13 17:09 JeffBobbo

What about the other existing project? Is it really useful to have two project with an equivalent behaviour?

GCorbel avatar Sep 10 '13 18:09 GCorbel

Nothing stops us from going in a different direction eventually.

Personally I'm just waiting for the ARM lib so I can put this on my Raspberry Pi and have fun with that. XD

JeffBobbo avatar Sep 10 '13 18:09 JeffBobbo

Pffff... I tried to do a very little thing with C++, to add a config parser, and I doesn't works. I tried to include librairies or to follow tutorials and I've always differents errors. I did it successfuly with Python in 3.2 seconds and I tried to it since 4/5 hours with CPP without result. It's probably because I new with c++ but I think I'm a good developper and I come back to primary school.

C++ is not so complicated but manage dependencies seems to be, especialy without big IDE (I use vim). Tools like bundler or PIP are very very very useful...

I've nothing more to say about it. I just wanted to moan.

GCorbel avatar Sep 11 '13 23:09 GCorbel

If you can hop on IRC (or tell me a server you hang out on or something) I can take a look if you wish?

I'm currently in #leapmotion on FreeNode.

JeffBobbo avatar Sep 11 '13 23:09 JeffBobbo

What you think about introduce a depency to simplify the development. I think to Boost or QT. Boost is lighter but QT can be useful to do a gui. Both are offering useful methods like split or hash lists. I don't like to add a dependency but development will be faster and cleaner.

GCorbel avatar Sep 13 '13 21:09 GCorbel