LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2015, 01:04 PM   #1
eminembnja
LQ Newbie
 
Registered: Dec 2015
Posts: 4

Rep: Reputation: Disabled
Bind script or keystroke on mouse/touchpad movement


Hi!

Is there some way to bind some action to mouse movement? For now I need to send some keys instead of movement for one device (not all). Also, need to ignore pointer itself movement.

For instance, left moving sends <- keystoke or execs some script, etc. Some kind of gestures.

Thank you.
 
Old 12-24-2015, 02:19 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i don't know if a readymade exists, but it's definitely possible.

there's various hotcorner scripts out there, either as part of a desktop environment or as standalone solutions.

you will want to look into apps like xev and xdotool, amongst others. i think xdotool alone can get you pretty far.
 
Old 12-24-2015, 03:27 PM   #3
eminembnja
LQ Newbie
 
Registered: Dec 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Examined xdotool now. It would be useful to send keys, right. But I can't find any way how to bind anything to movement.

'Easystroke' app is almost what I need, BUT it require pressed button, so inusable.
 
Old 12-24-2015, 06:14 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
xdotool can do mouse movement, too.
but of course you have to write yourself a script that utilizes these functions.

no clue what easystroke is. sounds androidy.
 
Old 12-24-2015, 09:13 PM   #5
eminembnja
LQ Newbie
 
Registered: Dec 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
xdotool can do mouse movement, too.
but of course you have to write yourself a script that utilizes these functions.

no clue what easystroke is. sounds androidy.
Nope, I need not to send mouse clicks/positions but bind/map script to mouse movement, like gesture control, eh.
Here is easystroke: http://lifehacker.com/5049268/easyst...-easy-in-linux
As I mentioned before, it requires some mouse button to be pressed, so unsuitable.

Other soft briefly tested is Touchegg and ginn - seems works with multitouch touchpads only. Anyway, not figured out yet how to configure properly.
 
Old 12-25-2015, 12:31 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by eminembnja View Post
Nope, I need not to send mouse clicks/positions but bind/map script to mouse movement, like gesture control, eh.
yes, xdotool can tell you where the mouse pointer is, without clicking anything.
you can use that in some script that would then interprete these positions as gestures.

but i'm beginning to notice that there's a serious flaw in that approach; it means that every mouse movement would be interpreted as a gesture.
this makes sense on a touchscreen device, but on a normal screen/mouse/keyboard combo, the mouse would become unusable for anything else.
 
Old 12-26-2015, 07:08 AM   #7
eminembnja
LQ Newbie
 
Registered: Dec 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
yes, xdotool can tell you where the mouse pointer is, without clicking anything.
you can use that in some script that would then interprete these positions as gestures.

but i'm beginning to notice that there's a serious flaw in that approach; it means that every mouse movement would be interpreted as a gesture.
this makes sense on a touchscreen device, but on a normal screen/mouse/keyboard combo, the mouse would become unusable for anything else.
Yes, so one of requirements is to catch only one device and leave alone other. I am Win programmer and can relatively easy make this in C#, but stucked with Lin. Considering that gestures are really simple, there is just direction&length of stroke evaluation.

xinput allows to remap mouse buttons for particular device, but nothing with movement.

I'll look on xdotool deeper, thank you.
 
Old 12-27-2015, 03:40 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
can't you code it in C?
it has all those X server bindings... i don't know much about it.

it's a rather complex task, scripting it might be less than optimal.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Touchpad Pointer Movement Has Too Much Motion rc nai Linux - Laptop and Netbook 4 10-24-2012 01:37 PM
Cannot figure how to get a mouse event to cause a keystroke askrabal Linux - General 1 03-14-2010 11:12 PM
Logitech LX500 - Mouse click results in keystroke insanetek Linux - Hardware 0 07-11-2005 07:55 PM
Bind keystroke to mouse button ryand Linux - Hardware 1 12-04-2003 04:50 PM
mapping mouse button to keystroke? ldhertert Linux - General 2 11-19-2003 10:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration