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.
 
 
 
 
 
 
BC Ko 14b7e3bdc1
2435 refactor missiles part 2 (#2635)
5 years ago
..
devices Fix mem leak in game_controller.cpp 5 years ago
README.md 🎨 Format code 5 years ago
axis_direction.cpp 🎨 Run readability-identifier-naming on all src sub-folders 5 years ago
axis_direction.h Clang-tidy: readability-inconsistent-declaration-parameter-name 5 years ago
controller.cpp Clang-tidy: readability-static-accessed-through-instance 5 years ago
controller.h 🚚 Restructure files 5 years ago
controller_buttons.h Modernize deprecated headers 5 years ago
controller_motion.cpp Fix warnings in controller_motion.cpp 5 years ago
controller_motion.h Clang-tidy: readability-inconsistent-declaration-parameter-name 5 years ago
game_controls.cpp Remove some more use of miniwin 5 years ago
game_controls.h Modernize deprecated headers 5 years ago
keymapper.cpp Fix Keymapper doesn't set any default keys if no diablo.ini is present (after installation) 5 years ago
keymapper.hpp Keymapper: remove now useless INI access functions 5 years ago
menu_controls.cpp 🎨 Correct type checks in src sub-folder 5 years ago
menu_controls.h Modernize deprecated headers 5 years ago
modifier_hints.cpp Rename UiFlags members to group related options 5 years ago
modifier_hints.h 🚚 Rename `CelOutputBuf` to `Surface` and extract 5 years ago
plrctrls.cpp 2435 refactor missiles part 2 (#2635) 5 years ago
plrctrls.h ♻️ Replace 'coord' struct with 'Point' 5 years ago
remap_keyboard.h 🚚 Restructure files 5 years ago
touch.cpp General clean up 5 years ago
touch.h Clang-tidy: readability-inconsistent-declaration-parameter-name 5 years 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