boppreh / mouse

Hook and simulate global mouse events in pure Python
MIT License
900 stars 135 forks source link

Touchpad issues on Linux #103

Open linux-man opened 2 years ago

linux-man commented 2 years ago

I'm on a laptop, and found that the touchpad move event are associated with EV_ABS, so to receive "MoveEvent" I had to change listen(queue) at _nixmouse.py:

elif type == EV_REL:

to

elif type in (EV_REL, EV_ABS):

The coordinates look fine.

What looks difficult is to detect which button was pressed (all clicks are "LEFT"), 2-fingers scroll and discriminate the "moving" touch from the "click" touch. Can that info be hidden on EV_MSC events?

changeso commented 10 months ago

are you deal with the issue? I have the same problem, my process only receive EV_ABS, I cann't use EV_REL to get input_event

linux-man commented 10 months ago

No. That's why I decided to use different libraries, the other being pyinput. Have a look at https://github.com/linux-man/inmon.