def is_pressed(hotkey):
_listener.start_if_necessary()<EOL>if _is_number(hotkey):<EOL><INDENT>with _pressed_events_lock:<EOL><INDENT>return hotkey in _pressed_events<EOL><DEDENT><DEDENT>steps = parse_hotkey(hotkey)<EOL>if len(steps) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>with _pressed_events_lock:<EOL><INDENT>pressed_scan_codes = set(_pressed_events)<EOL><DEDENT>for scan_codes in steps[<NUM_LIT:0>]:<EOL><INDENT>if not any(scan_code in pressed_scan_codes for scan_code in scan_codes):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
Returns True if the key is pressed.

    is_pressed(57) #-> True
    is_pressed('space') #-> True
    is_pressed('ctrl+space') #-> True