-
-
Notifications
You must be signed in to change notification settings - Fork 78
GoldSrc:Toggles
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.
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.
Just look in the Command reference for commands that start with + or -.
If you have contributed to the Wiki, you can make an issue in contrib repository in order to be added to or updated in the credits.
A list of things missing is in the Wanted article.
(Half-Life 1, Counter-Strike 1.6, ...)
(CS:GO, ...)
(Counter-Strike 2)