Update mouse library

This commit is contained in:
2022-06-10 20:03:25 +02:00
parent d62667a652
commit ad319e19af
12 changed files with 2 additions and 12 deletions
-4
View File
@@ -167,10 +167,6 @@ def on_button(callback, args=(), buttons=(LEFT, MIDDLE, RIGHT, X, X2), types=(UP
_listener.add_handler(handler) _listener.add_handler(handler)
return handler return handler
def on_pressed(callback, args=()):
""" Invokes `callback` with `args` when the left button is pressed. """
return on_button(callback, args, [LEFT], [DOWN])
def on_click(callback, args=()): def on_click(callback, args=()):
""" Invokes `callback` with `args` when the left button is clicked. """ """ Invokes `callback` with `args` when the left button is clicked. """
return on_button(callback, args, [LEFT], [UP]) return on_button(callback, args, [LEFT], [UP])
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -7
View File
@@ -20,8 +20,6 @@ EV_REL = 0x02
EV_ABS = 0x03 EV_ABS = 0x03
EV_MSC = 0x04 EV_MSC = 0x04
INVALID_ARGUMENT_ERRNO = 22
def make_uinput(): def make_uinput():
import fcntl, struct import fcntl, struct
@@ -31,12 +29,8 @@ def make_uinput():
fcntl.ioctl(uinput, UI_SET_EVBIT, EV_KEY) fcntl.ioctl(uinput, UI_SET_EVBIT, EV_KEY)
UI_SET_KEYBIT = 0x40045565 UI_SET_KEYBIT = 0x40045565
try: for i in range(256):
for i in range(0x300):
fcntl.ioctl(uinput, UI_SET_KEYBIT, i) fcntl.ioctl(uinput, UI_SET_KEYBIT, i)
except OSError as e:
if e.errno != INVALID_ARGUMENT_ERRNO:
raise e
BUS_USB = 0x03 BUS_USB = 0x03
uinput_user_dev = "80sHHHHi64i64i64i64i" uinput_user_dev = "80sHHHHi64i64i64i64i"
Binary file not shown.
Binary file not shown.