Bindings and User Settings: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Crispy (talk | contribs)
m revert spam
No edit summary
 
(31 intermediate revisions by 11 users not shown)
Line 1: Line 1:
This page should contain a list of key bindings and other user-modifiable settings.
<!-- search keywords: impulse _impulse mlook _mlook freelook-->
==Introduction to Key Binding==
A key (or device button) can be bound in-advance to a particular function. Then, during active game play, hitting that key will invoke that function. There are 3 main ways to manage key binding:
# Using TDM's main menu system, under "Settings/Controls".
# Enter "bind" commands in the console.
# Directly edit the "bind" commands in the DarkmodKeybinds.cfg file.


== Movement Related ==
Generally, after you change a key binding, you have to restart the game for it to take effect.


=== Commands ===
A given key can be:
* bound to a function.
* bound to no function.
* bound to a do-nothing placeholder (a function in name only).
* bound to a list of console commands, separated by semicolons. (This will not be much considered here, but see "Keys Available for Binding" below for an example of this.)


* '''_button5''': Creep
A key can only be bound to one thing, so just the latest bind takes effect. Keep that in mind if editing the .cfg file. As for Settings/Controls submenus, if you re-assign a previously bound key, elsewhere in the menu, the old assignment will be immediately and visibly removed.


* '''_impulse24''': Mantle (without jumping)
A given function can have zero or more bound keys that invoke it.
===Binding with TDM's "Settings/Controls" Menus===
TDM's "Settings/Controls" offers 6 submenus. Find the submenu and row with the particular function of interest, then:
* Hover the mouse cursor over the bound-key area on the right-hand side.
* Clicking LMB will show "Press any key...".
* Pressing a key (or device button) will add it. Multiple keys bound to the same function will be shown separated by " or ".


* '''_impulse41''': Frob
Further below, tables with details of default key bindings are organized like the 6 submenus.
===Unbinding===
* For a Settings/Controls menu item: Proceed as if you were going to add a key, but in response to "Press any key...", hit {{key|ESC}} instead.
* In the console, do either:
unbind "''key''"
bind "''key''" ""
* When editing a .cfg file, note that it routinely starts with
unbindall
So, simply don't bind any keys you don't want to.


* '''_impulse44''': Lean Forward
=== Examples of "Bind"===
* '''_impulse45''': Lean Left
* '''_impulse46''': Lean Right


=== Cvars ===
To add a keybind in the DarkmodKeybinds.cfg file, look at the following examples of the syntax:


* '''in_toggleCrouch''': If set to '''1''', causes the crouch button to act as a toggle.
unbindall
bind "ESCAPE" "togglemenu"
bind "SPACE" "_moveup"
bind "#" "_mlook"
bind "+" "_impulse48"
bind "0" "_impulse10"
bind "^" "_impulse0"
bind "a" "_moveleft"
; compass
bind "c" "inventory_hotkey '#str_02397'"
bind "d" "_moveright"
; spyglass
bind "g" "inventory_use '#str_02396'"
; keys
bind "k" "inventory_cycle_group '#str_02392'"
; lantern
bind "l" "inventory_use '#str_02395'"
bind "m" "inventory_cycle_maps"
; lockpicks
bind "p" "inventory_cycle_group '#str_02389'"
; readables
bind "r" "inventory_cycle_group '#str_02391'"
bind "s" "_back"
 
Note that some keys have special names (SPACE, ENTER, ESCAPE), and some items are referred to by their string template to make it work with [[I18N|internationalization]].
 
===Naming of Functions Intended for Binding===
''This concerns function names you might use with the "bind" command, as opposed to the Settings/Controls submenus.''
 
The naming of functions has legacy aspects, but generally:
* A "_" prefix indicates a parameterless function intended for key binding, where:
** _impulse''N'', where ''N'' ranges from 0 to 63, indicates a key meant to fire a behavior once on key-down;
** _button"X", where ''X'' ranges from 0 to 7, confusingly indicates a key meant to be held down (analgous to a shift key);
** almost all _impulse and _button functions that are important have a more user-friendly alias, e.g.,"_frob".
** Some impulse-like functions have '''only''' friendly names, e.g., "_moveLeft".
* Other functions highlighted in this article without a "_" prefix also may be primarily intended for key binding, but take a optional or required parameter.
 
=="Bind" Functions, Organized as in the 6 Settings/Controls Submenus==
 
 
=== Controls/Movement ===
{| class="wikitable" style="margin-right:auto"
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Forward ||style="text-align:right;" | w or uparrow ||"w" ''or'' "UPARROW"|| "_forward"||
|-
|Backward ||style="text-align:right;" | s or downarrow ||"s" ''or'' "DOWNARROW"|| "_back"||
|-
|Strafe Left ||style="text-align:right;" | a ||"a"|| "_moveLeft"||
|-
|Strafe Right ||style="text-align:right;" | d ||"d"|| "_moveRight||
|-
|Run ||style="text-align:right;" | shift ||"SHIFT"|| "_speed" ||When in motion. See "Related Cvars" below.
|-
|Creep ||style="text-align:right;" | ctrl ||"CTRL"|| "_creep" ''or'' "_button5"||When in motion
|-
|Turn Left ||style="text-align:right;" | leftarrow ||"LEFTARROW"|| "_left" ||
|-
|Turn Right ||style="text-align:right;" | rightarrow ||"RIGHTARROW"|| "_right" ||
|-
|Lean Left ||style="text-align:right;" | q ||"q"|| "_lean_left" ''or'' "_impulse45"||
|-
|Lean Right ||style="text-align:right;" | e ||"e"|| "_lean_right" ''or'' "_impulse46"||
|-
|Lean Forward ||style="text-align:right;" | f ||"f"|| "_lean_forward" ''or'' "_impulse44"||
|-
|Look Up ||style="text-align:right;" | pgdn ||"PGDN"|| "_lookup" ||
|-
|Look Down ||style="text-align:right;" | del ||"DEL"|| "_lookdown" ||
|}
 
====About "Free Look" or "Mouse Look"====
In the 1990s, first-person shooter games like Doom and Doom 2 often used the mouse to:
* look around horizontally (side to side) only
* move forwards and backwards
 
Because the player could not look up or down with the mouse, Doom had an "auto-aim" feature that directed the player's shots at shootable targets that were above, below, or straight ahead in the player's field of view. Subsequently, most games (including Doom 3 and TDM) made auto-aim unnecessary by moving to "free look" style, where:
* the mouse also controls looking up and down
* forward and backwards motions are key-controlled.
 
To make this optional, there is a Cvar:
 
* '''in_freelook''': if set to '''1''' (the default), freelook is on. If '''0''', off.
 
For either style, during play, there is a default key bind to toggle "free look" on and off:
bind "#" "_mlook"
This binding command assumes an ISANSI German keyboard, where "#" is on an unshifted key to the far right of {{key|P}}. The corresponding key on other keyboards (including US) is often {{key|\}}.
 
====Additional Movement-Related Default Bindings====
To allow - when holding down either ALT key - mouse left or right movements to cause sideways motion instead of turning:
bind "ALT" "_strafe"
To level the player's view, that is, not looking up or down:
bind "END" "_center_view" ''or'' "_impulse18"
====Related CVars====
* '''in_toggleRun''': If set to '''1''', causes the run button to act as a toggle.
* '''in_toggleRun''': If set to '''1''', causes the run button to act as a toggle.
* '''in_alwaysRun''': If set to '''1''', causes the player to always run. (probably not useful in a stealth game)
* '''in_alwaysRun''': If set to '''1''', the player will always run... not very useful in a stealth game.
 
 
===Controls/Actions===
 
{| class="wikitable" style="margin-right:auto"
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Frob/Interact ||style="text-align:right;" | mouse2 ||"MOUSE2"|| "_frob" ''or'' "_impulse41"||
|-
|Attack ||style="text-align:right;" | mouse1 ||"MOUSE1"|| "_attack" ||
|-
|Parry/Manipulate ||style="text-align:right;" | z or mouse3 ||"z" ''or'' "MOUSE3"|| "_parry" ''or'' "_zoom"||
|-
|Crouch ||style="text-align:right;" | x ||"x"|| "_crouch" ''or'' "_impulse23"||See "Related Cvars" below
|-
|Jump/Mantle ||style="text-align:right;" | space ||"SPACE"|| "_jump" ''or'' "_moveup"||
|-
|Mantle ||style="text-align:right;" | c ||"c"|| "_mantle" ''or'' "_impulse24"||Without jump
|}
 
====Available Related Bind Functions====
* "_impulse40"  ''Grab item with grabber''
 
==== Related Cvars ====
* '''tdm_toggle_crouch''': If set to '''1''', causes the crouch button to act as a toggle. (Note: Doom 3's "in_toggleCrouch" no longer applies to TDM).
 
 
===Controls/Inventory===
{| class="wikitable" style="margin-right:auto"
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Use Inv. Item ||style="text-align:right;" | enter or u ||"ENTER" or "u"|| "_inventory_use" ''or'' "_impulse51"||Function includes key-hold-down aspects. Uses current selection. See also "inventory_use 'item'", to use specific item by name.
|-
|Drop Inv. Item ||style="text-align:right;" | r ||"r"|| "_impulse52"||
|-
|Next Inv. Item ||style="text-align:right;" | [ ||"["|| "_inventory_next" ''or'' "_impulse48"||Key to right of "]". Misleading display of wrong key on US keyboards.
|-
|Prev Inv. Item ||style="text-align:right;" | ] ||"]"|| "_inventory_prev" ''or'' "_impulse47"||
|-
|Next Inv. Group ||style="text-align:right;" | - ||"-"|| "_inventory_group_next" ''or'' "_impulse50"||See also inventory_cycle_group 'groupname'
|-
|Prev Inv. Group ||style="text-align:right;" | = ||"="|| "_inventory_group_prev" ''or'' "_impulse49"||Caution: Menu display font for "=" hard to tell from "-"
|-
|Clear Inventory ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey \'\'"||
|-
|Cycle Maps ||style="text-align:right;" | m ||"m"|| "inventory_cycle_maps"||
|-
|Cycle Lockpicks ||style="text-align:right;" | p ||"p"|| "inventory_cycle_group '#str_02389'"||
|-
|Cycle Keys ||style="text-align:right;" | k ||"k"|| "inventory_cycle_group '#str_02392'"||
|-
|Cycle Readables ||style="text-align:right;" | i ||"i"|| "inventory_cycle_group '#str_02391'"||
|-
|Inventory Grid ||style="text-align:right;" | <empty> ||''none''|| "_inventory_grid" ''or'' "_impulse30"||Toggle seeing inventory
|}
 
 
====About Inventory_cycle_group====
* '''inventory_cycle_group''' '''''[category]''''' : Used for cycling through a specific group of items (e.g. lockpicks or keys). The name refers to the <tt>inv_category</tt> spawnarg.
:* '''inventory_cycle_group Keys''' : This will cycle through the available keys in the inventory (and wrap around).
 
{{infobox|Note: From v1.7 and onwards you should not use the English names of inventory categories or items, but instead their string template number. This ensures that the key bindings work regardless of the language you select in the Settings menu.}}
 
See also Commands/Tools for inventory_hotkey info, deployed for these specific inventory items: lantern, compass
 
=== Controls/Weapons ===
 
{| class="wikitable" style="margin-right:auto"
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Put away Weapons ||style="text-align:right;"|` ||"^"|| "_weapon0" ''or'' "_impulse0"||The key to the left of "1" key on main keyboard differs by country/language, with effect seen here.
|-
|Blackjack ||style="text-align:right;"|1 ||"1"|| "_weapon1" ''or'' "_impulse1"||
|-
|Shortsword ||style="text-align:right;"|2 ||"2"|| "_weapon2" ''or'' "_impulse2"||
|-
|Broadhead ||style="text-align:right;"|3 ||"3"|| "_weapon3" ''or'' "_impulse3"||
|-
|Water Arrow ||style="text-align:right;"|4 ||"4"|| "_weapon4" ''or'' "_impulse4"||
|-
|Fire Arrow ||style="text-align:right;"|5 ||"5"|| "_weapon5" ''or'' "_impulse5"||
|-
|Rope Arrow ||style="text-align:right;"|6 ||"6"|| "_weapon6" ''or'' "_impulse6"||
|-
|Gas Arrow ||style="text-align:right;"|7 ||"7"|| "_weapon7" ''or'' "_impulse7"||
|-
|Noisemaker ||style="text-align:right;" |8 ||"8"|| "_weapon8" ''or'' "_impulse8"||
|-
|Moss Arrow ||style="text-align:right;" |9 ||"9"|| "_weapon9" ''or'' "_impulse9"||
|-
|Vine Arrow ||style="text-align:right;" |0 ||"0"|| "_weapon10" ''or'' "_impulse10"||
|-
|Next Weapon ||style="text-align:right;" | wheeldown ||"MWHEELDOWN"|| "_weapon_next" ''or'' "_impulse14"|| At one time, the default wheelup/wheeldown bindings were reversed.
|-
|Previous Weapon ||style="text-align:right;" | wheelup ||"MWHEELUP"|| "_weapon_prev" ''or'' "_impulse15"||
|}


== Inventory Related ==


=== Commands ===
===Controls/General===


* '''_impulse47''' : Previous item.
{| class="wikitable" style="margin-right:auto"
* '''_impulse48''' : Next item.
|+ Related Cvars Shown at Start of General Menu
* '''_impulse49''' : Previous group.
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
* '''_impulse50''' : Next group.
|-
* '''_impulse51''' : Inventory Use item.
|'''Title'''||style="text-align:right;"| '''Default State'''|| '''Cvar Values'''|| '''Cvar Name'''||
* '''_impulse52''' : Inventory Drop item.
|-
|Toggle Crouch ||style="text-align:right;" | Enabled ||0;1|| "tdm_toggle_crouch"||
|-
|Always Run ||style="text-align:right;" | Disabled ||0;1|| "in_alwaysRun"||
|-
|Toggle Lean ||style="text-align:right;" | Disabled ||0;1|| "pm_lean_toggle"||
|-
|Free Look ||style="text-align:right;" | Enabled ||0;1|| "in_freeLook"||
|-
|Invert Mouse ||style="text-align:right;" | No ||0.022[No];-0.022[Yes]|| "m_pitch"||
|-
|Smooth Mouse ||style="text-align:right;" | (slider) ||1 to 8, step 1|| "m_smooth"||
|-
|Mouse Sensitivity ||style="text-align:right;" | (slider) ||1 to 30, step 0.5|| "sensitivity"||
|}
 
{| class="wikitable" style="margin-right:auto"
|+ Key Bindings in General Menu
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Objectives ||style="text-align:right;" | o ||"o"|| "_objective" ''or'' "_impulse19"||
|-
|Quicksave ||style="text-align:right;" | F4 ||"F4"|| "savegame quick"||
|-
|Quickload ||style="text-align:right;" | F9 ||"F9"|| "loadgame quick"||
|-
|Save Screenshot ||style="text-align:right;" | F12 ||"F12"|| "screenshot"||
|}
 
====Additional Default Bindings====
bind "ESCAPE" "togglemenu"
bind "F5" "loadgame" // non-quick version
 
 
===Controls/Tools===
{| class="wikitable" style="margin-right:auto"
!colspan="2"|Shown in Menu Row (Eng)!!colspan="2"|For Bind Command!!Comments
|-
|'''Title'''||style="text-align:right;"| '''Default Key'''|| '''Same Key'''|| '''Bind Function'''||
|-
|Toggle Lantern ||style="text-align:right;" | l ||"l"|| "inventory_use '#str_02395'"||Bound to lowercase L
|-
|Show Compass ||style="text-align:right;" | v ||"v"|| "inventory_hotkey '#str_02397'"||Toggle
|-
|Toggle Spyglass ||style="text-align:right;" | g ||"g"|| "inventory_use '#str_02396'"||
|-
|Flashbomb ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02438'"||
|-
|Flashmine ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02439'"||
|-
|Explosive Mine ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02202'"||
|-
|Health Potion ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02398'"||
|-
|Breath Potion ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02399'"||
|-
|Holy Water ||style="text-align:right;" | <empty> ||''none''|| "inventory_hotkey '#str_02400'"||
|}
 
====Additional Default Bindings====
bind "BACKSPACE" "inventory_hotkey"
 
====About Inventory_hotkey ====
''This allows you to select an item from inventory, but (unlike "inventory_use") not immediately use it''.
* '''inventory_hotkey ''[item]''''' : Used for setting up inventory hotkeys.
* '''inventory_hotkey ''[item]''''' : Used for setting up inventory hotkeys.
:* '''inventory_hotkey''' : Used by itself, it returns the hotkey string of the currently selected item, if one exists.
* '''inventory_hotkey''' : Used by itself, it returns the hotkey string of the currently selected item, if one exists.
:* '''inventory_hotkey someItem''' : Given a hotkey string, it selects a matching item.
:* '''inventory_hotkey someItem''' : Given a hotkey string, it selects a matching item.
:* '''inventory_hotkey ""''' : The empty string hotkey has a special meaning; it unselects inventory items.
:* '''inventory_hotkey ""''' : The empty string hotkey has a special meaning; it unselects inventory items.
: For example, with the compass selected, '''inventory_hotkey''' would return '''"compass"'''. Then typing '''inventory_hotkey compass''' will select the compass, if you have one.
: For example, with the compass selected, the '''inventory_hotkey''' would return '''"Compass"'''. Then typing '''inventory_hotkey Compass''' will select the compass, if you have one.
 
==Key Binding Beyond the Basics==
===Keys Available for Binding===
Function keys F10 and F11 have traditionally been left unassigned, for Doom3 and TDM gamers and devs to assign as needed. For example, suppose you want to bind F10 to a sequence of console commands, to do a dmap of your particular FM followed by running it. In the console first enter this, where <mapname> is replaced with the actual name:
bind F10 "clear; dmap <mapname>; wait; map <mapname>"
Subsequently, a press of F10 will perform that.
 
Besides F10 and F11, additional good key choices with TDM are shown in the following table.
 
{| class="wikitable" style="margin-right:auto"
|+ Keys Important to Doom 3 (e.g., for Multiplayer), but Available to Reassign in TDM
!colspan="3"|In Doom 3!!colspan="3"|In TDM [2.10]
|-
|'''Purpose'''||style="text-align:right;"| '''Default Key'''|| '''CFG Command ''' ||'''Still in CFG?'''|| '''If pressed?'''||'''Remnant Code?'''
|-
|Chat || t || bind "t" "''???''" || no || ignored || Associated with cvar "ui_chat" in Player.cpp & MultiplayerGame.cpp
|-
|Team chat || y || bind "y" "clientMessageMode 1" || yes || In console: unknown command "clientMessageMode" || See MessageMode(...) of MultiplayerGame.cpp.
|-
|Cast Yes vote || F1 || bind "F1" "_impulse28" || no || ignored || Vote handling in MultiplayerGame.cpp.
|-
|Cast No vote || F2 || bind "F2" "_impulse29" || no || ignored || Vote handling in MultiplayerGame.cpp.
|-
|Ready || F3 || bind "F3" "_ready" ''or'' "_impulse17" || no || ignored || ForceReady(...) in MultiplayerGame.cpp.
|-
|Change or toggle team || F6 || bind "F6" "_impulse20" || yes || ignored || _impulse20 is a placeholder function name
|-
|Spectate || F7 || bind "F7" "_impulse22" || yes || ignored || _impulse22 is a placeholder function name
|-
|PDA/Score || TAB || bind "TAB" "* "_showscores" [probably] || no || ignored || "_showScores" name is still defined as a type of hold-down _button, but ignored for single-player
|-
|Pause || PAUSE (aka break key) || bind "PAUSE" "pause" || yes || In console: unknown command "pause" ||
|}
 
===Key in Doom 3, Bound to Different Function in TDM===
Key "r" was "Reload" in Doom 3, but is "Drop Inventory Item" in TDM (as shown earlier). The Doom 3 binding was:
bind "r" "_reload"
Or equivalently to "_impulse13". There is remnant reload code in TDM.
 
===Logical Key Names===
The following are defined in Keyinput.cpp (for English; look there also for their #str_... codes.) Not all of these are actually usable as key (or device button) bindings. All the alphabetic letters are available in lower-case form. (Since SHIFT has a separate meaning during game play, it cannot be used to represent upper case as distinct from lower case.)
 
TAB ENTER ESCAPE SPACE BACKSPACE UPARROW DOWNARROW LEFTARROW RIGHTARROW
ALT RIGHTALT CTRL SHIFT LWIN RWIN MENU COMMAND CAPSLOCK SCROLL PRINTSCREEN
F1 ... F12
INS DEL PGDN PGUP HOME END
MOUSE1 ... MOUSE8 MWHEELUP MWHELLDOWN
JOY1 ... JOY32
AUX1 ... AUX16
KP_HOME KP_UPARROW KP_PGUP KP_LEFTARROW KP_5 KP RIGHTARROW KP_END KP_DOWNARROW
KP_PGDN KP_ENTER KP_INS KP_DEL KP_SLASH KP_MINUS KP_PLUS KP_NUMLOCK KP_STAR KP_EQUALS
PAUSE
SEMICOLON APOSTROPHE
 
===Available _Impulse Functions for Testing===
* "_impulse27": Toggle to show AAS areas and their cluster numbers. Colors are random.
* "_impulse25": For testing only, of the hiding spot search function relative to the player.


=== Cvars ===
===Toggling Cvars===
Besides the functions present in the Setting/Controls menus, any boolean Cvar can be usefully bound to a key. Some Cvars inherently toggle, e.g., "noclip". Others require using the "toggle" function. Syntax is:
bind "''key''" "toggle ''bool_cvar_name'' 0 1"
===Placeholder Functions===
Most _button and many _impulse names are defined but really don't do anything (in some cases because they are Doom 3 multiplayer leftovers). As of TDM 2.10, these are ''probably'' no-ops:
_impulse: 11-12 (_weapon11&12), 13(_reload), 16, 18(_ready), 20-22, 25-29, 31-40, 42-43, 53-63
_button: 0-4,6-7


* '''tdm_inv_grouping''' Determines whether or not the user-interface uses inventory grouping. It can be changed on the fly without losing the currently selected item.
===Gamepad Default Bindings===
:* '''0''' means to use a T1/T2 style interface. '''Previous item''' and '''Next item''' are used to scroll through the entire inventory. An empty slot exists between the last and first items of the inventory. '''Previous group''' and '''Next group''' are not functional.
<br>
:* '''1''' means to use inventory groups. '''Previous item''' and '''Next item''' are used to scroll through the items in the current group. An empty slot exists between the last and first items of a group. '''Previous group''' and '''Next group''' are used to scroll through the groups of the current inventory in alphabetical order.
<font size="4">
:* '''2''' is default, meaning to use a T1/T2 style interface but sort the inventory by group. Items within a given group retain their position relative to eachother, but all items in the first group exist before all items in the second group, and so on. '''Previous item''' and '''Next item''' are used to scroll through the entire inventory. An empty slot exists between the last and first items of the inventory. '''Previous group''' and '''Next group''' are used to scroll through the groups of the current inventory in alphabetical order.
* See the '''[https://github.com/fholger/thedarkmodvr/wiki/Gamepad-support Gamepad Support]''' wiki at Github
* '''tdm_inv_opacity''' : Controls the opacity of the inventory GUI. The range is anywhere from '''0''' to '''1''', where '''0''' makes it totally invisible and '''1''' makes it fully opaque.
</font>


== Object Manipulation ==
<br><br>In DarkmodPadbinds.cfg:
These are the detailed controls for object manipulation:
unbindPad
* Press '''Frob''' to pick up and drop moveable objects
bindPadButton MODIFIER PAD_L2
* Press '''Attack''' to throw an object that you've picked up. The longer you hold attack before releasing, the harder you throw it. Throwing is based on mass so you can throw lighter objects farther. The vanilla D3 mass settings are not realistic so you'll notice some things fly all over. That will be fixed by setting better mass ratios and air friction values in our TDM objects.
bindPadButton PRESS PAD_A "_jump"
* Press and hold '''zoom''' to enter "rotation mode"
bindPadButton PRESS PAD_B "_crouch"
:While holding zoom:
bindPadButton LONG_PRESS PAD_B "_mantle"
::*Move the mouse '''up/down''' to "pitch" an object (if straight ahead of you is X and up is Z, this would rotate around the Y axis)
bindPadButton PRESS PAD_X "_attack"
::*Move the mouse '''left/right''' to "roll" an object. This would be rotating around the X axis that comes out straight ahead of you. (I think we really need some visual illustrations for this... oh well)
bindPadButton PRESS PAD_Y "_inventory_use"
::*Move the mouse '''left/right''' while holding '''RUN''' to "yaw" the object around the Z axis (straight up). Image you're holding a coffee can right side up and you want to read the label on the other side by turning it toward you. This is what you're doing.
bindPadButton LONG_PRESS PAD_Y "_inventory_grid"
::*(Note: Holding run and moving the mouse up/down does nothing different)
bindPadButton PRESS PAD_L1 "_lean_left"
bindPadButton PRESS PAD_R1 "_lean_right"
bindPadButton MOD_PRESS PAD_R1 "_parry"
bindPadButton PRESS PAD_R2 "_frob"
bindPadButton MOD_PRESS PAD_R2 "_attack"
bindPadButton PRESS PAD_L3 "_speed"
bindPadButton LONG_PRESS PAD_R3 "inventory_use '#str_02396'"
bindPadButton MOD_LONG_PRESS PAD_R3 "inventory_use '#str_02395'"
bindPadButton PRESS PAD_BACK "_objectives"
bindPadButton LONG_PRESS PAD_BACK "savegame quick"
bindPadButton PRESS PAD_START "escape"
bindPadButton PRESS PAD_LEFT "inventory_cycle_group '#str_02392'"
bindPadButton MOD_PRESS PAD_LEFT "_weapon1"
bindPadButton MOD_LONG_PRESS PAD_LEFT "_weapon2"
bindPadButton PRESS PAD_RIGHT "inventory_cycle_group '#str_02389'"
bindPadButton MOD_PRESS PAD_RIGHT "_weapon3"
bindPadButton MOD_LONG_PRESS PAD_RIGHT "_weapon4"
bindPadButton PRESS PAD_UP "_inventory_prev"
bindPadButton LONG_PRESS PAD_UP "inventory_hotkey ''"
bindPadButton MOD_PRESS PAD_UP "_weapon_next"
bindPadButton MOD_LONG_PRESS PAD_UP "_weapon0"
bindPadButton PRESS PAD_DOWN "_inventory_next"
bindPadButton LONG_PRESS PAD_DOWN "_inventory_drop"
bindPadButton MOD_PRESS PAD_DOWN "_weapon_prev"


= [[Cvars]] =
==See Also==
The List of available Dark Mod Cvars can be found here: [[Cvars]]
The List of available Doom 3 Cvars can be found here: [http://www.iddevnet.com/doom3/cvars.php Doom 3 Cvars]


= Commands =
* TDM [[Cvars]] and [https://iddevnet.dhewm3.org/doom3/cvars.html Doom 3 Cvars]
The List of available Doom 3 console commands can be found here: [http://www.iddevnet.com/doom3/commands.php Doom 3 Console Commands]
* TDM [[Console Useful Controls]] and [https://iddevnet.dhewm3.org/doom3/commands.html Doom 3 Console Commands]
* [[GUI Scripting: BindDef]] delves further into how Settings/Controls menus are implemented.
* [https://forums.thedarkmod.com/index.php?/topic/20771-keymap-for-nextweaponwheel-down/#comment-456426 The meaning of _impulse and _button] are discussed by Dragofer and HMart.


[[Category:General]]
{{general}}

Latest revision as of 02:00, 11 June 2024

Introduction to Key Binding

A key (or device button) can be bound in-advance to a particular function. Then, during active game play, hitting that key will invoke that function. There are 3 main ways to manage key binding:

  1. Using TDM's main menu system, under "Settings/Controls".
  2. Enter "bind" commands in the console.
  3. Directly edit the "bind" commands in the DarkmodKeybinds.cfg file.

Generally, after you change a key binding, you have to restart the game for it to take effect.

A given key can be:

  • bound to a function.
  • bound to no function.
  • bound to a do-nothing placeholder (a function in name only).
  • bound to a list of console commands, separated by semicolons. (This will not be much considered here, but see "Keys Available for Binding" below for an example of this.)

A key can only be bound to one thing, so just the latest bind takes effect. Keep that in mind if editing the .cfg file. As for Settings/Controls submenus, if you re-assign a previously bound key, elsewhere in the menu, the old assignment will be immediately and visibly removed.

A given function can have zero or more bound keys that invoke it.

Binding with TDM's "Settings/Controls" Menus

TDM's "Settings/Controls" offers 6 submenus. Find the submenu and row with the particular function of interest, then:

  • Hover the mouse cursor over the bound-key area on the right-hand side.
  • Clicking LMB will show "Press any key...".
  • Pressing a key (or device button) will add it. Multiple keys bound to the same function will be shown separated by " or ".

Further below, tables with details of default key bindings are organized like the 6 submenus.

Unbinding

  • For a Settings/Controls menu item: Proceed as if you were going to add a key, but in response to "Press any key...", hit ESC instead.
  • In the console, do either:
unbind "key"
bind "key" ""
  • When editing a .cfg file, note that it routinely starts with
unbindall

So, simply don't bind any keys you don't want to.

Examples of "Bind"

To add a keybind in the DarkmodKeybinds.cfg file, look at the following examples of the syntax:

unbindall
bind "ESCAPE" "togglemenu"
bind "SPACE" "_moveup"
bind "#" "_mlook"
bind "+" "_impulse48"
bind "0" "_impulse10"
bind "^" "_impulse0"
bind "a" "_moveleft"
; compass
bind "c" "inventory_hotkey '#str_02397'"
bind "d" "_moveright"
; spyglass
bind "g" "inventory_use '#str_02396'"
; keys
bind "k" "inventory_cycle_group '#str_02392'"
; lantern
bind "l" "inventory_use '#str_02395'"
bind "m" "inventory_cycle_maps"
; lockpicks
bind "p" "inventory_cycle_group '#str_02389'"
; readables
bind "r" "inventory_cycle_group '#str_02391'"
bind "s" "_back"

Note that some keys have special names (SPACE, ENTER, ESCAPE), and some items are referred to by their string template to make it work with internationalization.

Naming of Functions Intended for Binding

This concerns function names you might use with the "bind" command, as opposed to the Settings/Controls submenus.

The naming of functions has legacy aspects, but generally:

  • A "_" prefix indicates a parameterless function intended for key binding, where:
    • _impulseN, where N ranges from 0 to 63, indicates a key meant to fire a behavior once on key-down;
    • _button"X", where X ranges from 0 to 7, confusingly indicates a key meant to be held down (analgous to a shift key);
    • almost all _impulse and _button functions that are important have a more user-friendly alias, e.g.,"_frob".
    • Some impulse-like functions have only friendly names, e.g., "_moveLeft".
  • Other functions highlighted in this article without a "_" prefix also may be primarily intended for key binding, but take a optional or required parameter.

"Bind" Functions, Organized as in the 6 Settings/Controls Submenus

Controls/Movement

Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Forward w or uparrow "w" or "UPARROW" "_forward"
Backward s or downarrow "s" or "DOWNARROW" "_back"
Strafe Left a "a" "_moveLeft"
Strafe Right d "d" "_moveRight
Run shift "SHIFT" "_speed" When in motion. See "Related Cvars" below.
Creep ctrl "CTRL" "_creep" or "_button5" When in motion
Turn Left leftarrow "LEFTARROW" "_left"
Turn Right rightarrow "RIGHTARROW" "_right"
Lean Left q "q" "_lean_left" or "_impulse45"
Lean Right e "e" "_lean_right" or "_impulse46"
Lean Forward f "f" "_lean_forward" or "_impulse44"
Look Up pgdn "PGDN" "_lookup"
Look Down del "DEL" "_lookdown"

About "Free Look" or "Mouse Look"

In the 1990s, first-person shooter games like Doom and Doom 2 often used the mouse to:

  • look around horizontally (side to side) only
  • move forwards and backwards

Because the player could not look up or down with the mouse, Doom had an "auto-aim" feature that directed the player's shots at shootable targets that were above, below, or straight ahead in the player's field of view. Subsequently, most games (including Doom 3 and TDM) made auto-aim unnecessary by moving to "free look" style, where:

  • the mouse also controls looking up and down
  • forward and backwards motions are key-controlled.

To make this optional, there is a Cvar:

  • in_freelook: if set to 1 (the default), freelook is on. If 0, off.

For either style, during play, there is a default key bind to toggle "free look" on and off:

bind "#" "_mlook"

This binding command assumes an ISANSI German keyboard, where "#" is on an unshifted key to the far right of P. The corresponding key on other keyboards (including US) is often \.

Additional Movement-Related Default Bindings

To allow - when holding down either ALT key - mouse left or right movements to cause sideways motion instead of turning:

bind "ALT" "_strafe"

To level the player's view, that is, not looking up or down:

bind "END" "_center_view" or "_impulse18"

Related CVars

  • in_toggleRun: If set to 1, causes the run button to act as a toggle.
  • in_alwaysRun: If set to 1, the player will always run... not very useful in a stealth game.


Controls/Actions

Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Frob/Interact mouse2 "MOUSE2" "_frob" or "_impulse41"
Attack mouse1 "MOUSE1" "_attack"
Parry/Manipulate z or mouse3 "z" or "MOUSE3" "_parry" or "_zoom"
Crouch x "x" "_crouch" or "_impulse23" See "Related Cvars" below
Jump/Mantle space "SPACE" "_jump" or "_moveup"
Mantle c "c" "_mantle" or "_impulse24" Without jump

Available Related Bind Functions

  • "_impulse40" Grab item with grabber

Related Cvars

  • tdm_toggle_crouch: If set to 1, causes the crouch button to act as a toggle. (Note: Doom 3's "in_toggleCrouch" no longer applies to TDM).


Controls/Inventory

Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Use Inv. Item enter or u "ENTER" or "u" "_inventory_use" or "_impulse51" Function includes key-hold-down aspects. Uses current selection. See also "inventory_use 'item'", to use specific item by name.
Drop Inv. Item r "r" "_impulse52"
Next Inv. Item [ "[" "_inventory_next" or "_impulse48" Key to right of "]". Misleading display of wrong key on US keyboards.
Prev Inv. Item ] "]" "_inventory_prev" or "_impulse47"
Next Inv. Group - "-" "_inventory_group_next" or "_impulse50" See also inventory_cycle_group 'groupname'
Prev Inv. Group = "=" "_inventory_group_prev" or "_impulse49" Caution: Menu display font for "=" hard to tell from "-"
Clear Inventory <empty> none "inventory_hotkey \'\'"
Cycle Maps m "m" "inventory_cycle_maps"
Cycle Lockpicks p "p" "inventory_cycle_group '#str_02389'"
Cycle Keys k "k" "inventory_cycle_group '#str_02392'"
Cycle Readables i "i" "inventory_cycle_group '#str_02391'"
Inventory Grid <empty> none "_inventory_grid" or "_impulse30" Toggle seeing inventory


About Inventory_cycle_group

  • inventory_cycle_group [category] : Used for cycling through a specific group of items (e.g. lockpicks or keys). The name refers to the inv_category spawnarg.
  • inventory_cycle_group Keys : This will cycle through the available keys in the inventory (and wrap around).
Note: From v1.7 and onwards you should not use the English names of inventory categories or items, but instead their string template number. This ensures that the key bindings work regardless of the language you select in the Settings menu.

See also Commands/Tools for inventory_hotkey info, deployed for these specific inventory items: lantern, compass

Controls/Weapons

Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Put away Weapons ` "^" "_weapon0" or "_impulse0" The key to the left of "1" key on main keyboard differs by country/language, with effect seen here.
Blackjack 1 "1" "_weapon1" or "_impulse1"
Shortsword 2 "2" "_weapon2" or "_impulse2"
Broadhead 3 "3" "_weapon3" or "_impulse3"
Water Arrow 4 "4" "_weapon4" or "_impulse4"
Fire Arrow 5 "5" "_weapon5" or "_impulse5"
Rope Arrow 6 "6" "_weapon6" or "_impulse6"
Gas Arrow 7 "7" "_weapon7" or "_impulse7"
Noisemaker 8 "8" "_weapon8" or "_impulse8"
Moss Arrow 9 "9" "_weapon9" or "_impulse9"
Vine Arrow 0 "0" "_weapon10" or "_impulse10"
Next Weapon wheeldown "MWHEELDOWN" "_weapon_next" or "_impulse14" At one time, the default wheelup/wheeldown bindings were reversed.
Previous Weapon wheelup "MWHEELUP" "_weapon_prev" or "_impulse15"


Controls/General

Related Cvars Shown at Start of General Menu
Shown in Menu Row (Eng) For Bind Command Comments
Title Default State Cvar Values Cvar Name
Toggle Crouch Enabled 0;1 "tdm_toggle_crouch"
Always Run Disabled 0;1 "in_alwaysRun"
Toggle Lean Disabled 0;1 "pm_lean_toggle"
Free Look Enabled 0;1 "in_freeLook"
Invert Mouse No 0.022[No];-0.022[Yes] "m_pitch"
Smooth Mouse (slider) 1 to 8, step 1 "m_smooth"
Mouse Sensitivity (slider) 1 to 30, step 0.5 "sensitivity"
Key Bindings in General Menu
Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Objectives o "o" "_objective" or "_impulse19"
Quicksave F4 "F4" "savegame quick"
Quickload F9 "F9" "loadgame quick"
Save Screenshot F12 "F12" "screenshot"

Additional Default Bindings

bind "ESCAPE" "togglemenu"
bind "F5" "loadgame" // non-quick version


Controls/Tools

Shown in Menu Row (Eng) For Bind Command Comments
Title Default Key Same Key Bind Function
Toggle Lantern l "l" "inventory_use '#str_02395'" Bound to lowercase L
Show Compass v "v" "inventory_hotkey '#str_02397'" Toggle
Toggle Spyglass g "g" "inventory_use '#str_02396'"
Flashbomb <empty> none "inventory_hotkey '#str_02438'"
Flashmine <empty> none "inventory_hotkey '#str_02439'"
Explosive Mine <empty> none "inventory_hotkey '#str_02202'"
Health Potion <empty> none "inventory_hotkey '#str_02398'"
Breath Potion <empty> none "inventory_hotkey '#str_02399'"
Holy Water <empty> none "inventory_hotkey '#str_02400'"

Additional Default Bindings

bind "BACKSPACE" "inventory_hotkey"

About Inventory_hotkey

This allows you to select an item from inventory, but (unlike "inventory_use") not immediately use it.

  • inventory_hotkey [item] : Used for setting up inventory hotkeys.
  • inventory_hotkey : Used by itself, it returns the hotkey string of the currently selected item, if one exists.
  • inventory_hotkey someItem : Given a hotkey string, it selects a matching item.
  • inventory_hotkey "" : The empty string hotkey has a special meaning; it unselects inventory items.
For example, with the compass selected, the inventory_hotkey would return "Compass". Then typing inventory_hotkey Compass will select the compass, if you have one.

Key Binding Beyond the Basics

Keys Available for Binding

Function keys F10 and F11 have traditionally been left unassigned, for Doom3 and TDM gamers and devs to assign as needed. For example, suppose you want to bind F10 to a sequence of console commands, to do a dmap of your particular FM followed by running it. In the console first enter this, where <mapname> is replaced with the actual name:

bind F10 "clear; dmap <mapname>; wait; map <mapname>"

Subsequently, a press of F10 will perform that.

Besides F10 and F11, additional good key choices with TDM are shown in the following table.

Keys Important to Doom 3 (e.g., for Multiplayer), but Available to Reassign in TDM
In Doom 3 In TDM [2.10]
Purpose Default Key CFG Command Still in CFG? If pressed? Remnant Code?
Chat t bind "t" "???" no ignored Associated with cvar "ui_chat" in Player.cpp & MultiplayerGame.cpp
Team chat y bind "y" "clientMessageMode 1" yes In console: unknown command "clientMessageMode" See MessageMode(...) of MultiplayerGame.cpp.
Cast Yes vote F1 bind "F1" "_impulse28" no ignored Vote handling in MultiplayerGame.cpp.
Cast No vote F2 bind "F2" "_impulse29" no ignored Vote handling in MultiplayerGame.cpp.
Ready F3 bind "F3" "_ready" or "_impulse17" no ignored ForceReady(...) in MultiplayerGame.cpp.
Change or toggle team F6 bind "F6" "_impulse20" yes ignored _impulse20 is a placeholder function name
Spectate F7 bind "F7" "_impulse22" yes ignored _impulse22 is a placeholder function name
PDA/Score TAB bind "TAB" "* "_showscores" [probably] no ignored "_showScores" name is still defined as a type of hold-down _button, but ignored for single-player
Pause PAUSE (aka break key) bind "PAUSE" "pause" yes In console: unknown command "pause"

Key in Doom 3, Bound to Different Function in TDM

Key "r" was "Reload" in Doom 3, but is "Drop Inventory Item" in TDM (as shown earlier). The Doom 3 binding was:

bind "r" "_reload"

Or equivalently to "_impulse13". There is remnant reload code in TDM.

Logical Key Names

The following are defined in Keyinput.cpp (for English; look there also for their #str_... codes.) Not all of these are actually usable as key (or device button) bindings. All the alphabetic letters are available in lower-case form. (Since SHIFT has a separate meaning during game play, it cannot be used to represent upper case as distinct from lower case.)

TAB ENTER ESCAPE SPACE BACKSPACE UPARROW DOWNARROW LEFTARROW RIGHTARROW
ALT RIGHTALT CTRL SHIFT LWIN RWIN MENU COMMAND CAPSLOCK SCROLL PRINTSCREEN
F1 ... F12
INS DEL PGDN PGUP HOME END
MOUSE1 ... MOUSE8 MWHEELUP MWHELLDOWN
JOY1 ... JOY32
AUX1 ... AUX16
KP_HOME KP_UPARROW KP_PGUP KP_LEFTARROW KP_5 KP RIGHTARROW KP_END KP_DOWNARROW
KP_PGDN KP_ENTER KP_INS KP_DEL KP_SLASH KP_MINUS KP_PLUS KP_NUMLOCK KP_STAR KP_EQUALS
PAUSE
SEMICOLON APOSTROPHE

Available _Impulse Functions for Testing

  • "_impulse27": Toggle to show AAS areas and their cluster numbers. Colors are random.
  • "_impulse25": For testing only, of the hiding spot search function relative to the player.

Toggling Cvars

Besides the functions present in the Setting/Controls menus, any boolean Cvar can be usefully bound to a key. Some Cvars inherently toggle, e.g., "noclip". Others require using the "toggle" function. Syntax is:

bind "key" "toggle bool_cvar_name 0 1"

Placeholder Functions

Most _button and many _impulse names are defined but really don't do anything (in some cases because they are Doom 3 multiplayer leftovers). As of TDM 2.10, these are probably no-ops: _impulse: 11-12 (_weapon11&12), 13(_reload), 16, 18(_ready), 20-22, 25-29, 31-40, 42-43, 53-63 _button: 0-4,6-7

Gamepad Default Bindings




In DarkmodPadbinds.cfg:

unbindPad
bindPadButton MODIFIER PAD_L2
bindPadButton PRESS PAD_A "_jump"
bindPadButton PRESS PAD_B "_crouch"
bindPadButton LONG_PRESS PAD_B "_mantle"
bindPadButton PRESS PAD_X "_attack"
bindPadButton PRESS PAD_Y "_inventory_use"
bindPadButton LONG_PRESS PAD_Y "_inventory_grid"
bindPadButton PRESS PAD_L1 "_lean_left"
bindPadButton PRESS PAD_R1 "_lean_right"
bindPadButton MOD_PRESS PAD_R1 "_parry"
bindPadButton PRESS PAD_R2 "_frob"
bindPadButton MOD_PRESS PAD_R2 "_attack"
bindPadButton PRESS PAD_L3 "_speed"
bindPadButton LONG_PRESS PAD_R3 "inventory_use '#str_02396'"
bindPadButton MOD_LONG_PRESS PAD_R3 "inventory_use '#str_02395'"
bindPadButton PRESS PAD_BACK "_objectives"
bindPadButton LONG_PRESS PAD_BACK "savegame quick"
bindPadButton PRESS PAD_START "escape"
bindPadButton PRESS PAD_LEFT "inventory_cycle_group '#str_02392'"
bindPadButton MOD_PRESS PAD_LEFT "_weapon1"
bindPadButton MOD_LONG_PRESS PAD_LEFT "_weapon2"
bindPadButton PRESS PAD_RIGHT "inventory_cycle_group '#str_02389'"
bindPadButton MOD_PRESS PAD_RIGHT "_weapon3"
bindPadButton MOD_LONG_PRESS PAD_RIGHT "_weapon4"
bindPadButton PRESS PAD_UP "_inventory_prev"
bindPadButton LONG_PRESS PAD_UP "inventory_hotkey "
bindPadButton MOD_PRESS PAD_UP "_weapon_next"
bindPadButton MOD_LONG_PRESS PAD_UP "_weapon0"
bindPadButton PRESS PAD_DOWN "_inventory_next"
bindPadButton LONG_PRESS PAD_DOWN "_inventory_drop"
bindPadButton MOD_PRESS PAD_DOWN "_weapon_prev"

See Also