Half-Life Console Help

Advanced Techniques: Meta-Key Binds
Once you get started with scripts and special binds and aliases, you may find yourself running out of conveniently-located keys and buttons for all the binds you'd like to set. Wouldn't it be nice if you could bind the SHIFT-ed, CTRL-ed, or ALT-ed versions of keys to different commands? Well, you can, here's how:
bind shift +set_shifted
alias +set_shifted "bind1b; bind2b; bind3b; "
alias -set_shifted "bind1a; bind2a; bind3a; "

alias bind1a "bind 1 slot1"
alias bind1a "bind 2 slot1"
alias bind1a "bind 3 slot1"

alias bind1b "bind 1 msg1"
alias bind2b "bind 2 msg2"
alias bind3b "bind 3 msg3"

alias msg1 "say message text 1"
alias msg2 "say message text 2"
alias msg3 "say message text 3"
 

In this example, pressing the shift key re-binds the 1, 2, and 3 keys from their normal slotX weapon selection commands to the chat messages defined in the msgX aliases. Releasing the shift key re-binds these number keys back to normal. You could easily extend this concept to allow shifted versions of more keys, or add ALT and CTRL support. 

It works, but it's definitely a hack, and there's sure to be practical limits to the number of keys you can meta-bind this way. If you experience any problems, try meta-binding fewer keys.
 
[Previous Page] [Back to Console Index] [Next Page]