def press(self, key_code):
if key_code >= <NUM_LIT>:<EOL><INDENT>ev = NSEvent.otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2_(<EOL><NUM_LIT>, <EOL>(<NUM_LIT:0>, <NUM_LIT:0>), <EOL><NUM_LIT>, <EOL><NUM_LIT:0>, <EOL><NUM_LIT:0>, <EOL><NUM_LIT:0>, <EOL><NUM_LIT:8>, <EOL>((key_code-<NUM_LIT>) << <NUM_LIT:16>) | (<NUM_LIT> << <NUM_LIT:8>), <EOL>-<NUM_LIT:1> <EOL>)<EOL>Quartz.CGEventPost(<NUM_LIT:0>, ev.CGEvent())<EOL><DEDENT>else:<EOL><INDENT>event_flags = <NUM_LIT:0><EOL>if self.current_modifiers["<STR_LIT>"]:<EOL><INDENT>event_flags += Quartz.kCGEventFlagMaskShift<EOL><DEDENT>if self.current_modifiers["<STR_LIT>"]:<EOL><INDENT>event_flags += Quartz.kCGEventFlagMaskAlphaShift<EOL><DEDENT>if self.current_modifiers["<STR_LIT>"]:<EOL><INDENT>event_flags += Quartz.kCGEventFlagMaskAlternate<EOL><DEDENT>if self.current_modifiers["<STR_LIT>"]:<EOL><INDENT>event_flags += Quartz.kCGEventFlagMaskControl<EOL><DEDENT>if self.current_modifiers["<STR_LIT>"]:<EOL><INDENT>event_flags += Quartz.kCGEventFlagMaskCommand<EOL><DEDENT>if key_code == <NUM_LIT>: <EOL><INDENT>self.current_modifiers["<STR_LIT>"] = True<EOL><DEDENT>elif key_code == <NUM_LIT> or key_code == <NUM_LIT>: <EOL><INDENT>self.current_modifiers["<STR_LIT>"] = True<EOL><DEDENT>elif key_code == <NUM_LIT>: <EOL><INDENT>self.current_modifiers["<STR_LIT>"] = True<EOL><DEDENT>elif key_code == <NUM_LIT>: <EOL><INDENT>self.current_modifiers["<STR_LIT>"] = True<EOL><DEDENT>elif key_code == <NUM_LIT>: <EOL><INDENT>self.current_modifiers["<STR_LIT>"] = True<EOL><DEDENT>event = Quartz.CGEventCreateKeyboardEvent(None, key_code, True)<EOL>Quartz.CGEventSetFlags(event, event_flags)<EOL>Quartz.CGEventPost(Quartz.kCGHIDEventTap, event)<EOL>time.sleep(<NUM_LIT>)<EOL><DEDENT>
Sends a 'down' event for the specified scan code