def start_recording(recorded_events_queue=None):
recorded_events_queue = recorded_events_queue or _queue.Queue()<EOL>global _recording<EOL>_recording = (recorded_events_queue, hook(recorded_events_queue.put))<EOL>return _recording<EOL>
Starts recording all keyboard events into a global variable, or the given
queue if any. Returns the queue of events and the hooked function.

Use `stop_recording()` or `unhook(hooked_function)` to stop.