Closed jnv closed 8 years ago
@SavinaRoja
I've checked grab_keyboard() method in python-xlib and python3-xlib, they both only accept 5 parameters:
def grab_keyboard(self, owner_events, pointer_mode, keyboard_mode, time)
To fix this problem, just remove useless arguments in pykeyboard/x11.py:
self.display2.screen().root.grab_keyboard(X.KeyPressMask | X.KeyReleaseMask, X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime)
I think this is fixed? Could anyone confirm?
After subclassing PyKeyboardEvent and setting
self.capture = True
I get this error:This is obvious by looking into python3-xlib source. Maybe the API changed from
python-xlib
?The following fix works for me: https://github.com/jnv/PyUserInput/commit/81da6dfb9c056f40623c085dda86c6aae80857d9 though I'm not quite sure I got the arguments right. It captures the keyboard and releases it with a workaround suggested in #48.