#How to do key combination binds?

1 messages · Page 1 of 1 (latest)

proud mulch
#

I have a keyboard with no numpad. I want to do like for example, having to press and hold down shift then another key to kill/explode self.

plain creek
proud mulch
#

is this correct?

#

this might sound stupid

proud mulch
#

i tested it out. killbind still happens when I press just the secondary button

plain creek
# proud mulch Like I want to do left alt + R to killbind so I make a bind in this way ``` b...

for this, when ALT is held, it executes +killself which binds R to -killself which executes kill.
when ALT is released, it executes -killself which executes kill.

so you'd end up dying after pressing/releasing alt and R now kills you. there's also nothing rebinding R to what it was before, so it'll stay permanently bound to -killself once ALT is pressed. -killself gets automatically executed when ALT is released, so you shouldn't need to bind it to R anyway (unless you're wanting it to automatically unhold ALT as soon as R is pressed, but in this case it wouldn't make sense to do that because the only functionality is to kill when ALT + R is pressed--it would make more sense to do that if you're adding multiple keys to work with ALT, like ALT + E etc)

what you want to do with the aliases is to bind and rebind keys according to ALT being held/unheld

#

in this case you'd want to do

alias -killself "bind R +reload"``` (or whatever you're wanting the r key to be when you release alt)
proud mulch
#

Didn't know there's this part in Scripting page of the wiki. Thanks for the help anyways!