Closed chapmanjacobd closed 2 months ago
Are you trying to write a right-click on release? If so, you need to do
ui.write(e.EV_KEY, e.BTN_RIGHT, 1)
ui.syn()
ui.write(e.EV_KEY, e.BTN_RIGHT, 0)
ui.syn()
I think your code could benefit from this pattern by the way: https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html
that works, thanks
I'm not able to press a button if the grabbed device is already pressing it :/
Here is a small reproducible example:
It would be nice to be able to do this... Here is my full script: https://github.com/chapmanjacobd/computer/blob/main/bin/wheel.py
I guess in the meanwhile I can use
xdotool
https://github.com/chapmanjacobd/computer/commit/79a22c77f9232bde396d26606846c0cd28693fcf