I am using QThread
(pyside) for handling global hot-keys on X11. I have some simple while loop which looks like:
while self.doRun:
event=root.display.next_event()
if event.type==X.KeyPress:
....
But next_event()
is known for waiting for actual event. So how do I stop that loop without waiting for another keystroke? I was thinking about sending fake event with keypress via Xlib but I don't think that's a right way. Also .terminate()
on that event is not an option... with pyside it crashes whole app with:
Fatal Python error: This thread state must be current when releasing
Any ideas?