devilutionX/Source/controls
2021-09-29 18:15:26 +02:00
..
devices Fix mem leak in game_controller.cpp 2021-08-17 17:46:13 +02:00
touch Fix case for blank virtual gamepad potion buttons 2021-09-26 01:52:19 +02:00
axis_direction.cpp
axis_direction.h
controller.cpp
controller.h
controller_buttons.h
controller_motion.cpp Add virtual gamepad event handlers and implement touch controls 2021-09-16 19:25:31 +02:00
controller_motion.h
game_controls.cpp Add buttons for using potions from belt 2021-09-25 23:21:25 +02:00
game_controls.h
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
menu_controls.cpp
menu_controls.h
modifier_hints.cpp Translatable mainpanel 2021-09-19 07:21:52 +02:00
modifier_hints.h
plrctrls.cpp Assign ctrl to drop items 2021-09-29 18:15:26 +02:00
plrctrls.h
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