Sometimes 5 fingers aren't enough. I bet you had situations in the past that you wish you had tentacles to press all the keys you want to
Fortunately there's an easy way to rebind the same key to do something different. I call them "Switch keys".
What are "Switch" keysI call a switch key a key that is bound to an alias that changes other key's binds (which i call multi-bind keys), and restores them when the switch key is unpressed.
The binds in multi-bind keys are changed by the "switch" key. For example, in my cfg the key 4 is a multi bind key. When im playing, it "say_team Get quad". But when im pressing the switch key (the TAB key), it "say_team Get Quad at 32", being 32 the second that quad spawns (it's a timer script, which we will talk in later blogs). When i release TAB, it restores the original "Get Quad" message. What I mean is,
the switch key changes the bind of the multi-bind keys, only during the period i'm pressing it. Then when I release the switch key, the binds in multi-bind keys are restored to their original values.
I felt the need of using multi-bind keys because i love teamplay, and I would like to have more fingers to be able to send more informative messages to my teammates. So, i started using multi-bind keys. This way, one key can have multiple meanings, and I control that.
How to create switch and multi-bind keysHere's an example:
// when the switch is pressed, it binds the keys to the new meaning
alias +switch "con_notifylines 2; +showteamscores; bind SPACE _trick; bind MOUSE2 _packs"
//when the switch is released, the original binds are restored to the same keys
alias -switch "con_notifylines 5; -showteamscores; bind SPACE +jump ; bind MOUSE2 +lg"
(...)
//original binds
bind TAB +switch // the switch key
bind SPACE +jump // the normal space bind
bind MOUSE2 +lg // the normal mouse2 bind
In this example, TAB is the switch key, and SPACE and MOUSE2 are the keys affected by the switch key.
The normal binds for space and mouse2 are +jump and shoot lg respectively.
When i
press the switch key, the following happens:
- reduces the notifylines in the console;
- shows the scores;
- binds SPACE to a different alias;
- binds MOUSE2 to a different alias;
When i
release the switch key, the following happens:
- increases the notifylines in the console to the default value;
- hides the scores;
- binds SPACE back to the original alias;
- binds MOUSE2 back to the original alias;
In the next blog entry we will talk about setting the timer using a Switch key.
Can you find these "switches" useful? Post it in the comments!
Back to T&T index