DeSmuME_Input - Keyboard And Joystick Controls - Py-desmume

Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Hide navigation sidebar Hide table of contents sidebar Skip to content py-desmume documentation
  • Quick Start
  • API DocumentationToggle navigation of API Documentation
    • desmume.emulator moduleToggle navigation of desmume.emulator module
      • DeSmuME - Emulator base class
      • DeSmuME_Input - Keyboard and Joystick controls
      • DeSmuME_Savestate - Managing savestates
      • DeSmuME_Movie - Movie recording and playback
      • DeSmuME_Memory - R/W access to the DS memory
      • MemoryAccessor - Pythonic way to read and write the memory
      • RegisterAccessor - Reading and writing from/to registers
      • DeSmuME_SDL_Window - Easy way to display the emulator
      • Misc. classes
    • desmume.controls module
  • GTK+ Integration
Back to top View this page Edit this page Toggle Light / Dark / Auto color theme Toggle table of contents sidebar DeSmuME_Input - Keyboard and Joystick controls¶ classdesmume.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.

On this page
  • DeSmuME_Input - Keyboard and Joystick controls
    • DeSmuME_Input
      • DeSmuME_Input.joy_get_key()
      • DeSmuME_Input.joy_get_set_key()
      • DeSmuME_Input.joy_init()
      • DeSmuME_Input.joy_number_connected()
      • DeSmuME_Input.joy_set_key()
      • DeSmuME_Input.joy_uninit()
      • DeSmuME_Input.keypad_add_key()
      • DeSmuME_Input.keypad_get()
      • DeSmuME_Input.keypad_rm_key()
      • DeSmuME_Input.keypad_update()
      • DeSmuME_Input.touch_release()
      • DeSmuME_Input.touch_set_pos()

Tag » How To Change Controls Desmume