DeSmuME_Input - Keyboard and Joystick controls

class desmume.emulator.DeSmuME_Input(emu: DeSmuME)[source]

Bases: object

Manage 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 index to the specified joystick key joystick_key_index. Joysticks must be initialized.

joy_uninit()[source]

De-initialize the joystick input processing.

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_get() int[source]

Returns the current emulator key keypad (pressed DS buttons).

keypad_rm_key(key: int)[source]

Removes a key from the emulators current keymask (releases it). See keypad_add_key for a usage example.

keypad_update(keys: int) int[source]

Update the keypad (pressed DS buttons) of currently pressed emulator keys. You should probably use keypad_add_key and keypad_rm_key instead.

touch_release()[source]

Tell the emulator, that the user released touching the screen.

touch_set_pos(x: int, y: int)[source]

Set the specified coordinate of the screen to be touched.