Skip to content

GoldSrc:Toggles

Dominik Tugend edited this page Feb 21, 2024 · 2 revisions

Toggles are special commands that, when being bound to a key, can react when the key is being pressed and when it is being released again. (Normal commands would only react when the key is being pressed).

They can be bound to a key by entering the following into the game's console:

bind "keyname" "+togglename"

This will bind the toggle togglename to the key named keyname. When pressing the key down it will issue the +togglename command and when releasing the key -togglename will be called.

For more information see various Half-Life 1 scripting sites on the net.

Important notice:

You may want to avoid binding toggles under some conditions, because when resuming into the game it will call the key release event in case you bound the toggle to any key.

This is a problem e.g. with +mirv_recordmovie and the Optimize Visibility HLAE Launcher setting, because when recording the window is brought on-top the game loses focus and then the release version (-mirv_recordmovie) is triggered, causing the recording to stop again quickly and the process repeats while you keep the recordmovie key pressed.

We suggest binding the non-toggling versions linked above instead.

List of toggles

Just look in the Command reference for commands that start with + or -.

See also

(Half-Life 1, Counter-Strike 1.6, ...)

(CS:GO, ...)

(Counter-Strike 2)

Clone this wiki locally