From Valve Developer Community
Revision as of 22:33, 10 December 2019 by MrFunreal (talk | contribs) (accidentally deleted the "special keys" title when doing th elast edit. so i added it again)

Jump to: navigation, search

bind is a console command that lets you bind other console commands to a key.

Bug: Commands like +forward may not work when in multi-command chains inside binds. See alias for possible solutions.



If you wanted to make your v key toggle noclip, you would type bind "v" "noclip" in the console.

Note:Quotation marks around strings are not always required, but should be used to ensure that special characters, such as spaces and semicolons, are not misinterpreted.

Special Keys

Bind name Key
tab Tabulator (Above Capslock)
capslock Capslock
shift Shift (Below Capslock)
backspace Backspace (Above Enter)
enter Enter
escape "ESC" (Top Left of keyboard)
space Spacebar
alt Alt (Left of Spacebar)
uparrow Up Arrow
downarrow Down Arrow
leftarrow Left Arrow
rightarrow Right Arrow
ins Insert (Above arrows)
del Delete (Above arrows)
pgdn Page Down (Above arrows)
pgup Page Up (Above arrows)
home Home (Above arrows)
end End (Above arrows)
pause Pause / Break (Above arrows)
kp_end Keypad 1
kp_downarrow Keypad 2
kp_pgdn Keypad 3
kp_leftarrow Keypad 4
kp_5 Keypad 5
kp_rightarrow Keypad 6
kp_home Keypad 7
kp_uparrow Keypad 8
kp_pgup Keypad 9
kp_enter Keypad Enter
kp_ins Keypad 0
kp_del Keypad .
kp_slash Keypad /
kp_multiply Keypad *
kp_minus Keypad -
kp_plus Keypad +
mwheeldown Mouse - Scroll Down
mwheelup Mouse - Scroll Up
mouse1 Mouse - Left click
mouse2 Mouse - Right click
mouse3 Mouse - Wheel click
mouse4 Mouse - Page Back
mouse5 Mouse - Page Forward
joy1-4 To do: Explain
aux1-31 To do: Explain

Related console commands

To do: binds_per_command


A convenient command for toggling a Cvar on or off by pressing a key. Functionally identical to bind KEY "incrementvar CVAR 0 1 1".

BindToggle KEY CVAR

If you wanted your p key to turn sv_cheats on or off, you would type BindToggle p sv_cheats.


Functions identically to bind except it only affects Mac OS users, not Windows.

To do: What about Linux...?


The opposite of bind. Sets a key to do nothing.

unbind KEY

To make your left click do nothing, you would type unbind MOUSE1.


Functions identically to unbind except it only affects Mac OS users, not Windows.

To do: What about Linux...?


The infamous command that unbinds all the keys.

Tip:If you do this command (or you're a poor sap that got tricked), you can reset to default bindings in the Options menu. Keyboard, Use Defaults.


Lists all keys that are bound to something, and what they are bound to.

Example input and output from Half-Life 2:


Searches through the list of bound keys and returns the ones that have a given substring in the command field.

key_findbinding STRING

Example input and output from Half-Life 2:

] key_findbinding slot
"1" = "slot1"
"2" = "slot2"
"3" = "slot3"
"4" = "slot4"
"5" = "slot5"
"6" = "slot6"

To do: key_updatelayout

See Also