Page 1 of 1
dynamic key binding
Posted: Sun Aug 17, 2003 8:06 am
by {R.E.D}**Duke Justice**
Hello y'all
I have a question regarding dynamic binding.
Suppose I have the keyboard key "k" bound to the "screenshot" command. But At times, I would like to have it bound to "dropweapon". I would like these dunctions to be toggled by the key "o".
Could anyone suggest me how to go about this.
Regards
Duke
Posted: Sun Aug 17, 2003 8:21 am
by Alcoholic
lol I don't know if you can use if statements in .cfg files... You'll need 2 keys that switch them. like this
bind k "screenshot"
bind a "bind k screenshot"
bind s "bind k dropweapon"
Posted: Sun Aug 17, 2003 10:09 am
by {R.E.D}**Duke Justice**
Thank you Alcoholic for your prompt answer.
It works just fine.
Is there a way to use the same key and use it as a toggle? Like a fast nades script that exists?
Here is an example:
alias hf1 "hud_fastswitch 1"
alias hf0 "hud_fastswitch 0"
alias fgren grenadeon
alias grenadeon "bind mouse2 +gren; alias fgren grenadeoff; locationprint 10 360 "*****Fast-Nades-On*******"
alias grenadeoff "bind mouse2 +attacksecondary; alias fgren grenadeon; locationprint 10 360 "*****Fast-Nades-Off*******"
alias +gren "hf1; useweaponclass grenade; hf0"
alias -gren "hf1; uselast; hf0"
bind x "fgren"
Thanks in advance if you can help. And thanks again for your post.
Regards
Duke
Posted: Wed Aug 20, 2003 3:41 am
by CorporalPunishment
You can use alias command to do it:
alias SSon "bind k screenshot: alias Switch SSoff"
alias SSoff "bind k dropweapon: alias Switch SSon"
alias Switch "SSon"
finally bind the Switch:
bind s "Switch"
So the S key becomes the toggle key
Posted: Thu Aug 21, 2003 12:46 am
by {R.E.D}**Duke Justice**
Hey great idea.
Works like a charm.
Regards
Duke