devilutionX/Source/controls
Juliano Leal Goncalves 379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
..
devices Fix mem leak in game_controller.cpp 2021-08-17 17:46:13 +02:00
axis_direction.cpp 🎨 Run readability-identifier-naming on all src sub-folders 2021-04-22 03:53:35 +02:00
axis_direction.h Clang-tidy: readability-inconsistent-declaration-parameter-name 2021-06-27 01:06:00 +02:00
controller.cpp Clang-tidy: readability-static-accessed-through-instance 2021-06-27 00:56:08 +02:00
controller.h
controller_buttons.h Modernize deprecated headers 2021-04-25 02:50:31 +02:00
controller_motion.cpp Fix warnings in controller_motion.cpp 2021-07-17 14:35:21 +02:00
controller_motion.h Clang-tidy: readability-inconsistent-declaration-parameter-name 2021-06-27 01:06:00 +02:00
game_controls.cpp Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
game_controls.h Modernize deprecated headers 2021-04-25 02:50:31 +02:00
keymapper.cpp Fix Keymapper doesn't set any default keys if no diablo.ini is present (after installation) 2021-08-07 16:32:52 +02:00
keymapper.hpp Keymapper: remove now useless INI access functions 2021-07-27 21:12:22 +02:00
menu_controls.cpp 🎨 Correct type checks in src sub-folder 2021-04-22 20:33:24 +02:00
menu_controls.h Modernize deprecated headers 2021-04-25 02:50:31 +02:00
modifier_hints.cpp Implement new font rendering 2021-09-12 01:37:28 +02:00
modifier_hints.h 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
plrctrls.cpp ♻️ Convert 'ItemType' enum to enum class 2021-09-13 00:25:49 +02:00
plrctrls.h ♻️ Replace 'coord' struct with 'Point' 2021-05-31 06:05:13 +02:00
README.md
remap_keyboard.h
touch.cpp General clean up 2021-07-08 03:30:25 -07:00
touch.h Clang-tidy: readability-inconsistent-declaration-parameter-name 2021-06-27 01:06:00 +02: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