You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Eric Robinson e6032a69a8
Split control.cpp (#8347)
3 months ago
..
devices Assign GameController::instance_id_ before adding to controllers_ vector 4 months ago
touch Split control.cpp (#8347) 3 months ago
README.md 📝 Fixes Doxygen warnings (#4904) 4 years ago
axis_direction.cpp SDL3: Even more migration 5 months ago
axis_direction.h Clang-tidy: readability-inconsistent-declaration-parameter-name 5 years ago
control_mode.cpp Extract current input mode into its own library 1 year ago
control_mode.hpp Extract current input mode into its own library 1 year ago
controller.cpp SDL3: Add some backports / compat helpers 5 months ago
controller.h SDL3: Some more migration 5 months ago
controller_buttons.cpp Extract current input mode into its own library 1 year ago
controller_buttons.h Extract current input mode into its own library 1 year ago
controller_motion.cpp Split control.cpp (#8347) 3 months ago
controller_motion.h SDL3: Some more migration 5 months ago
game_controls.cpp SDL3: Some more migration 5 months ago
game_controls.h SDL3: Some more migration 5 months ago
input.h Fix a handful of SDL2 API calls 5 months ago
keymapper.cpp Split control.cpp (#8347) 3 months ago
keymapper.hpp SDL3: Even more migration 5 months ago
menu_controls.cpp SDL3: Add some backports / compat helpers 5 months ago
menu_controls.h SDL3: Even more migration 5 months ago
modifier_hints.cpp Split control.cpp (#8347) 3 months ago
modifier_hints.h Split up `engine.{h,cpp}` 1 year ago
padmapper.cpp Options: Move resolutions list init to display.cpp 1 year ago
padmapper.hpp Options: Extract padmapper handling from options 1 year ago
plrctrls.cpp Split control.cpp (#8347) 3 months ago
plrctrls.h SDL3: Even more migration 5 months ago
remap_keyboard.h SDL3: Even more migration 5 months ago

README.md

Controls handling

DevilutionX supports mouse & keyboard and gamepad input.

This directory currently mostly handles gamepad input.

Low-level gamepad handling is abstracted and 3 implementations are provided:

  1. SDL2 controller API.

  2. SDL 1&2 joystick API.

    This can be used in SDL1 joystick platforms and for mapping additional buttons not defined by SDL2 controller mappings (e.g. additional Nintendo Switch arrows).

  3. Keyboard keys acting as controller buttons.

    This can be used for testing, or on devices where this is the only or the easiest API to use (e.g. RetroFW).

Example keyboard-as-controller build flags:

cmake .. -DUSE_SDL1=ON -DHAS_KBCTRL=1 -DPREFILL_PLAYER_NAME=ON \
-DKBCTRL_BUTTON_DPAD_LEFT=SDLK_LEFT \
-DKBCTRL_BUTTON_DPAD_RIGHT=SDLK_RIGHT \
-DKBCTRL_BUTTON_DPAD_UP=SDLK_UP \
-DKBCTRL_BUTTON_DPAD_DOWN=SDLK_DOWN \
-DKBCTRL_BUTTON_X=SDLK_y \
-DKBCTRL_BUTTON_Y=SDLK_x \
-DKBCTRL_BUTTON_B=SDLK_a \
-DKBCTRL_BUTTON_A=SDLK_b \
-DKBCTRL_BUTTON_RIGHTSHOULDER=SDLK_RIGHTBRACKET \
-DKBCTRL_BUTTON_LEFTSHOULDER=SDLK_LEFTBRACKET \
-DKBCTRL_BUTTON_LEFTSTICK=SDLK_TAB \
-DKBCTRL_BUTTON_START=SDLK_RETURN \
-DKBCTRL_BUTTON_BACK=SDLK_LSHIFT