devilutionX/Source/controls
2022-01-20 23:12:48 +01:00
..
devices Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
touch Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
axis_direction.cpp
axis_direction.h
controller.cpp Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
controller.h Improve behavior of ToControllerButtonEvent() 2021-12-24 23:08:41 +01:00
controller_buttons.h
controller_motion.cpp Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
controller_motion.h
game_controls.cpp Touch support on all SDL2 platforms 2022-01-02 11:37:38 +01:00
game_controls.h clang-format all files in {Source,test}/ 2021-11-24 23:44:12 +01:00
input.h Improve behavior of ToControllerButtonEvent() 2021-12-24 23:08:41 +01:00
menu_controls.cpp Allow use of touch to select world objects 2022-01-02 11:37:38 +01:00
menu_controls.h
modifier_hints.cpp changed spell circle ui (#3963) 2022-01-19 02:34:04 +01:00
modifier_hints.h
plrctrls.cpp Change Missiles Array to std::list 2022-01-20 23:12:48 +01:00
plrctrls.h Allow use of touch to select world objects 2022-01-02 11:37:38 +01:00
README.md
remap_keyboard.h

#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