Bindings and User Settings: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Geep (talk | contribs)
MAJOR REDO! Twice the content, organized in tables, with intro
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 4: Line 4:
# Using TDM's main menu system, under "Settings/Controls".
# Using TDM's main menu system, under "Settings/Controls".
# Enter "bind" commands in the console.
# Enter "bind" commands in the console.
# Directly edit the "bind" commands in the DarkmodKeybind.cfg file.
# 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.
Generally, after you change a key binding, you have to restart the game for it to take effect.
Line 12: Line 12:
* bound to no function.
* bound to no function.
* bound to a do-nothing placeholder (a function in name only).
* 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 considered further here.)
* 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 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.
Line 320: Line 320:
==Key Binding Beyond the Basics==
==Key Binding Beyond the Basics==
===Keys Available for Binding===
===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"
{| class="wikitable" style="margin-right:auto"
|+ Keys Important to Doom 3 (e.g., for Multiplayer), but Available to Reassign in TDM
|+ Keys Important to Doom 3 (e.g., for Multiplayer), but Available to Reassign in TDM
Line 378: Line 384:


===Gamepad Default Bindings===
===Gamepad Default Bindings===
In DarkmodPadbinds.cfg:
<br>
<font size="4">
* See the '''[https://github.com/fholger/thedarkmodvr/wiki/Gamepad-support Gamepad Support]''' wiki at Github
</font>
 
<br><br>In DarkmodPadbinds.cfg:
  unbindPad
  unbindPad
  bindPadButton MODIFIER PAD_L2
  bindPadButton MODIFIER PAD_L2
Line 416: Line 427:
* TDM [[Cvars]] and [https://iddevnet.dhewm3.org/doom3/cvars.html Doom 3 Cvars]
* TDM [[Cvars]] and [https://iddevnet.dhewm3.org/doom3/cvars.html Doom 3 Cvars]
* TDM [[Console Useful Controls]] and [https://iddevnet.dhewm3.org/doom3/commands.html Doom 3 Console Commands]
* TDM [[Console Useful Controls]] and [https://iddevnet.dhewm3.org/doom3/commands.html Doom 3 Console Commands]
* [[GUI Scripting: BindDef]]
* [[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.


{{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