desmume.controls module¶
Some simple ports from sdlcntrl.cpp that are generally useful for dealing with controls.
Some of this only applies if used with GTK (eg. the keyboard configuration), other things apply generally, such as the joystick configuration.
- class desmume.controls.Joy[source]¶
Bases:
objectJoystick input types.
- JOY_AXIS = 0¶
- JOY_BUTTON = 2¶
- JOY_HAT = 1¶
- class desmume.controls.JoyHats[source]¶
Bases:
objectJostick hat identifiers.
- JOY_HAT_DOWN = 3¶
- JOY_HAT_LEFT = 1¶
- JOY_HAT_RIGHT = 0¶
- JOY_HAT_UP = 2¶
- class desmume.controls.Keys[source]¶
Bases:
objectDS key identifiers. NB_KEYS contains the total number of keys.
- KEY_A = 1¶
- KEY_B = 2¶
- KEY_BOOST = 14¶
- KEY_DEBUG = 13¶
- KEY_DOWN = 8¶
- KEY_L = 10¶
- KEY_LEFT = 6¶
- KEY_LID = 15¶
- KEY_NONE = 0¶
- KEY_R = 9¶
- KEY_RIGHT = 5¶
- KEY_SELECT = 3¶
- KEY_START = 4¶
- KEY_UP = 7¶
- KEY_X = 11¶
- KEY_Y = 12¶
- NB_KEYS = 15¶
- NO_KEY_SET = 65535¶
- desmume.controls.add_key(keypad, key)[source]¶
Add a key to a keypad -> press the key.
keyis the keymask returned bykeymask.You don’t need to call this manually, see
keypad_add_key()instead.
- desmume.controls.keymask(k)[source]¶
Returns the keymask for key
k.kis a constant of theKeysclass.
- desmume.controls.load_configured_config(emu: DeSmuME) Tuple[List[int], List[int]][source]¶
Load the default for inputs. Also set’s the default config for joystick in emulator.
The keyboard configuration is Gdk key IDs.
- Todo:
Support loading/saving from the DesMuME config file.