devilutionX/SourceX/controls
2020-11-28 22:58:13 +01:00
..
devices Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
controller.cpp Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
controller.h Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
controller_buttons.h Make controller enums C++03 compatible 2020-05-19 17:19:50 +02:00
controller_motion.cpp Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
controller_motion.h Controller: Fix L2/R2 handling 2020-11-28 17:58:55 +01:00
game_controls.cpp Multiple controllers support (#935) 2020-11-28 22:58:13 +01:00
game_controls.h Controller: Fix L2/R2 handling 2020-11-28 17:58:55 +01:00
menu_controls.cpp [switch] Leave TextInput running 2020-10-09 03:02:14 +02:00
menu_controls.h Make controller enums C++03 compatible 2020-05-19 17:19:50 +02:00
modifier_hints.cpp Fix rendering controller hints 2020-10-04 15:31:32 +02:00
modifier_hints.h Controller improvements: START modifier and hints 2020-01-25 16:37:50 +01:00
plrctrls.cpp Fix various controller issues 2020-11-28 15:02:53 +00:00
plrctrls.h Fix various controller issues 2020-11-28 15:02:53 +00:00
README.md Use LF for Markdown files instead of CRLF 2020-03-08 03:09:42 +01:00
remap_keyboard.h Allow re-mapping keyboard keys 2020-05-02 18:13:10 +02:00
touch.cpp Move generic helpers out of miniwin 2020-02-01 13:56:08 +01:00
touch.h Implement touch controls 2019-11-23 20:06:43 +01:00

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