Don't break keybinding service when we get an unexpected event
(onscreen keyboard)
This commit is contained in:
parent
9f8f76b0eb
commit
bc514d1c8c
@ -132,6 +132,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread):
|
||||
wait_for_release = False
|
||||
while self.running:
|
||||
event = self.display.next_event()
|
||||
try:
|
||||
self.current_event_time = event.time
|
||||
if event.detail == self.keycode and event.type == X.KeyPress and not wait_for_release:
|
||||
modifiers = event.state & self.known_modifiers_mask
|
||||
@ -147,6 +148,8 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread):
|
||||
self.display.allow_events(X.AsyncKeyboard, event.time)
|
||||
else:
|
||||
self.display.allow_events(X.ReplayKeyboard, event.time)
|
||||
except AttributeError:
|
||||
continue
|
||||
|
||||
def stop(self):
|
||||
self.running = False
|
||||
|
Loading…
Reference in New Issue
Block a user