def listen(queue):
if not os.geteuid() == <NUM_LIT:0>:<EOL><INDENT>raise OSError("<STR_LIT>")<EOL><DEDENT>listener = MouseEventListener(lambda e: queue.put(e) or is_allowed(e.name, e.event_type == KEY_UP))<EOL>t = threading.Thread(target=listener.run, args=())<EOL>t.daemon = True<EOL>t.start()<EOL>
Appends events to the queue (ButtonEvent, WheelEvent, and MoveEvent).