Half-Life 2

Half-Life 2

View Stats:
Ghidrah1 May 8, 2016 @ 1:39pm
Changing buttons
Sorry for not knowing the proper term, is there a way to change a button, (like duck) that must be held down to be active to one that can be toggled? Many of my other games, newer and older have the option.
< >
Showing 1-10 of 10 comments
MediArgentum May 9, 2016 @ 12:08am 
It's not possible to do that directly from the options menu but it IS possible to write a script for it. Here, let me do that real quick:
alias duck_on "+duck; wait; bind CTRL duck_off" alias duck_off "-duck; wait; bind CTRL duck_on" bind CTRL duck_on

put this script in your "autoexec.cfg" file that is located in your "steamapps\common\Half-Life 2\hl2\cfg" (If it's not there, create it and then write this script in it).
Last edited by MediArgentum; May 9, 2016 @ 12:09am
Calmly Frenetic May 9, 2016 @ 12:42am 
There are built-in options for toggle_duck and toggle_zoom, and you can "bind keys" to these actions using the developer console.

For example, to toggle duck with the "t" key, enter the command:
bind t toggle_duck

By default, the normal hold-down duck (+duck) is bound to the "CTRL" key.
Enter the command key_listboundkeys to see all of the current bindings.
MediArgentum May 9, 2016 @ 3:04am 
Originally posted by Calmly Frenetic:
There are built-in options for toggle_duck and toggle_zoom
Hm, didn't know about that.
Ghidrah1 May 9, 2016 @ 8:12am 
Thanks Calmly Frenetic will try that, I have stupid fingers, I'm still a 3 fingered per hand typer and must look at the keyboard for anything after QWE/ASD. Holding "duck" really messes up maneuvering.

No doubt this will solve my problem, but what command will reverse it if I ever decide to change back? Will [unbind t toggle_duck] do this?
Also inserting this will it work/spread to all HL2 games or must it be introduced to each?
Last edited by Ghidrah1; May 9, 2016 @ 8:14am
MediArgentum May 9, 2016 @ 8:15am 
If you want you can do
bind CTRL toggle_duck
to use CONTROL key to toggle crouching.

And you can also do
bind CTRL +duck
to bring the default version back (holding CONTROL key to crouch)

If you want to unbind something from any key (say, key T, in this instance), you just type
unbind t
Naturally, you can replace "T" with any other key.
Last edited by MediArgentum; May 9, 2016 @ 8:15am
Ghidrah1 May 9, 2016 @ 10:49am 
Thanks Argentum,

I figured it out after after adding "UN" to the original command didn't work. Stupid fingers, I began ducking perminently while fighting the striders at end of game, -0- sprint made me hunter fodder big time they're much more aggressive and brutal in hard mode. Toggle duck works best for me in urban and interior combat. Knowing the option now gives me an edge I didn't have before.

Is there a command console tutorial?
Can you bind more than one key to a function?
Last edited by Ghidrah1; May 9, 2016 @ 3:22pm
Ghidrah1 May 17, 2016 @ 3:27pm 
Again, guys thanks for the help, I die much less now. A recap on changing buttons, I ended up with mouse5 for toggle duck and mouse4 for recon toggle zoom I still have "Y" as suit zoom but only use it for precise distance targeting.
TheFirstDecade Jan 9, 2020 @ 12:51pm 
Now a toggle crouch button is what i needed, can't rely on crouch-jumping with an untoggleable button.
Ghidrah1 Jan 9, 2020 @ 3:14pm 
It saved me big time, I'm always in panic mode and was constantly moving my finger off the key. Especially at the beginning of "Under the Radar"
Viagra® Dealer Jul 9, 2020 @ 7:55am 
my s#*) keyboard doesn't have the console button ;(
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: May 8, 2016 @ 1:39pm
Posts: 10