Is there a library which can be used to read mouse movement and to pass certain hotkey combinations or trigger certain files on certain movements?

I want to make functions which will be able to respond on these mouse movements like for example a three touch finger drag should trigger window spread.


1 Answer 1


You can just use xdotool command like so:

xdotool getmouselocation

You can either use watch xdotool getmouselocation for interactive polling or if that's for bash script - write an infinite while loop.

while true
     xdotool getmouselocation

Not the answer you're looking for? Browse other questions tagged or ask your own question.