<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def start_recording(recorded_events_queue=None):
 """ 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. """

    recorded_events_queue = recorded_events_queue or _queue.Queue()
    global _recording
    _recording = (recorded_events_queue, hook(recorded_events_queue.put))
    return _recording