Update mouse library
This commit is contained in:
parent
d62667a652
commit
ad319e19af
|
@ -166,10 +166,6 @@ def on_button(callback, args=(), buttons=(LEFT, MIDDLE, RIGHT, X, X2), types=(UP
|
||||||
callback(*args)
|
callback(*args)
|
||||||
_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. """
|
||||||
|
|
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.
|
@ -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.
Loading…
Reference in New Issue