-
Notifications
You must be signed in to change notification settings - Fork 2
Gamepad support
The VR version has experimental support for gamepads. However, you need to provide a button mapping layout to the game to make it work, since there is currently no default layout, and it is also not configurable in the options.
Left and right sticks are hardwired and do what you'd expect them to - left is movement, right is camera control, or more precisely control of the aim indicator, just like mouse movement. You can invert the right stick's axes by enabling the CVars in_padInverseRX
and in_padInverseRY
.
Buttons can be mapped to two separate actions, a short press action and a long press action. The long press action is activated if you hold the button for a certain amount of time, otherwise the short press action is executed. Additionally, you can designate one button to be a modifier. If the modifier is held down, pressing another button will trigger alternative short or long press actions, so that each button (aside from the modifier) can be mapped to up to 4 different actions.
Gamepad button mappings are configured by creating a file called DarkmodPadbinds.cfg
in your TDM install folder. Here is an example of how the file may look like; you can copy this as a starting point to your installation:
// DarkmodPadbinds.cfg - gamepad button mappings
// MODIFIER KEY
bindPadButton MODIFIER PAD_L2
// ATTACK
bindPadButton MOD_PRESS PAD_R2 "_attack"
bindPadButton MOD_PRESS PAD_R1 "_parry"
bindPadButton PRESS PAD_X "_attack"
// WEAPONS
bindPadButton MOD_LONG_PRESS PAD_UP "_weapon0"
bindPadButton MOD_PRESS PAD_UP "_weapon_next"
bindPadButton MOD_PRESS PAD_DOWN "_weapon_prev"
bindPadButton MOD_PRESS PAD_LEFT "_weapon1"
bindPadButton MOD_LONG_PRESS PAD_LEFT "_weapon2"
bindPadButton MOD_PRESS PAD_RIGHT "_weapon3"
bindPadButton MOD_LONG_PRESS PAD_RIGHT "_weapon4"
// MOVEMENT / INTERACTION
bindPadButton PRESS PAD_A "_jump"
bindPadButton PRESS PAD_B "_crouch"
bindPadButton LONG_PRESS PAD_B "_mantle"
bindPadButton PRESS PAD_L1 "_lean_left"
bindPadButton PRESS PAD_R1 "_lean_right"
bindPadButton PRESS PAD_L3 "_speed"
bindPadButton PRESS PAD_R2 "_frob"
// INVENTORY
bindPadButton PRESS PAD_Y "_inventory_use"
bindPadButton LONG_PRESS PAD_Y "_inventory_grid"
bindPadButton PRESS PAD_UP "_inventory_prev"
bindPadButton PRESS PAD_DOWN "_inventory_next"
// cycle keys
bindPadButton PRESS PAD_LEFT "inventory_cycle_group '#str_02392'"
// cycle picks
bindPadButton PRESS PAD_RIGHT "inventory_cycle_group '#str_02389'"
bindPadButton LONG_PRESS PAD_UP "inventory_hotkey ''"
bindPadButton LONG_PRESS PAD_DOWN "_inventory_drop"
// spyglass
bindPadButton LONG_PRESS PAD_R3 "inventory_use '#str_02396'"
// lantern
bindPadButton MOD_LONG_PRESS PAD_R3 "inventory_use '#str_02395'"
// MISC
bindPadButton PRESS PAD_BACK "_objectives"
bindPadButton LONG_PRESS PAD_BACK "savegame quick"
bindPadButton PRESS PAD_START "escape"
Lines starting with //
are comments and ignored. Each mapping in the file is of the form bindPadButton <type> <button> <action>
, where <type>
is one of:
-
PRESS
- map the short press action for a button -
LONG_PRESS
- map the long press action for a button -
MOD_PRESS
- map the short press action for a button while the mod key is held -
MOD_LONG_PRESS
- map the long press action for a button while the mod key is held -
MODIFIER
- specify which button acts as the mod key
<button>
identifies the gamepad button to map, see the example file above to find the available button identifiers. Finally, <action>
is the ingame action to be executed when the button is pressed. Again, refer to the example file for possible mappings, or check your DarkmodKeybinds.cfg
file where the keyboard mappings are contained to find a specific action.
Unfortunately, TDM's UI system is hardwired for keyboard and mouse input and it would take significant effort and refactoring to implement a gamepad-friendly navigation. In order to make the gamepad usable with UI at all, it currently acts as a mouse emulation - the sticks will move the mouse cursor, and the right trigger acts as the mouse button in the menu (in ingame UIs, whichever button is mapped to the attack action will serve to activate UI elements).
The sample layout from above corresponds to the following button mappings:
Left trigger (LT) is the modifier key.
Bindings without modifier:
- A - jump
- B - crouch / B (long) - mantle
- X - attack
- Y - use inventory item / Y (long) - show inventory grid
- RT - frob
- LB - lean left
- RB - lean right
- LB+RB - lean forward
- DPAD UP - previous inventory item / DPAD UP (long) - clear inventory selection
- DPAD DOWN - next inventory item / DPAD DOWN (long) - drop inventory item
- DPAD LEFT - cycle keys
- DPAD RIGHT - cycle lockpicks
- L3 aka left-stick click - run
- R3 (long) - use spyglass
- BACK - show objectives / BACK (long) - quicksave
- START - toggle menu
Bindings while modifier key (LT) is held (focus on weapons):
- Mod + RT - attack
- Mod + RB - parry
- Mod + DPAD UP - previous weapon / Mod + DPAD UP (long) - holster weapon
- Mod + DPAD DOWN - next weapon
- Mod + DPAD LEFT - blackjack / Mod + DPAD LEFT (long) - sword
- Mod + DPAD_RIGHT - broadhead arrows / Mod + DPAD_RIGHT (long) - water arrows
- Mod + R3 (long) - toggle lantern
Feel free to modify the bindings any way you like!
The following CVars are available to control aspects of gamepad input:
-
in_padMouseSpeed
- controls how quickly the mouse cursor is moved by the sticks in the menu -
in_padDeadZone
- configures the dead zone for the sticks - you may wish to increase this if your sticks register input despite being in the neutral position -
in_padInverseRX
- inverts input from the right stick's X axis -
in_padInverseRY
- inverts input from the right stick's Y axis -
in_padLongPressTimeMs
- determines for how long a button needs to be pressed to register as a long press -
in_padL3HoldWhileDeflected
- if active, clicking the left stick will hold the associated action as long as the stick is deflected -
in_yawSpeed
- controls camera turning / horizontal aiming speed -
in_pitchSpeed
- controls vertical aiming speed