DeSmuME_Input - Keyboard and Joystick controls¶
- class desmume.emulator.DeSmuME_Input(emu: DeSmuME)[source]¶
Bases:
objectManage input processing for the emulator. Should not be instantiated manually!
- joy_get_key(index: int) int[source]¶
Get the joystick key assigned to the specified emulator key. Joysticks must be initialized.
- joy_get_set_key(index: int) int[source]¶
Pause the thread and wait for the user to press a button. This button will be assigned to the specified emulator key. Joysticks must be initialized.
- joy_init()[source]¶
Initialize the joystick input processing. Call this to enable automatic joystick input processing.
- joy_number_connected() int[source]¶
Returns the number of connected joysticks. Joysticks must be initialized.
- joy_set_key(index: int, joystick_key_index: int)[source]¶
Sets the emulator key
indexto the specified joystick keyjoystick_key_index. Joysticks must be initialized.
- keypad_add_key(key: int)[source]¶
Adds a key to the emulators current keymask (presses it). To be used with
keymask:>>> from desmume.controls import keymask, Keys >>> keym = keymask(Keys.KEY_A) >>> DeSmuME().input.keypad_add_key(keym)
- keypad_rm_key(key: int)[source]¶
Removes a key from the emulators current keymask (releases it). See
keypad_add_keyfor a usage example.