Skip to content

Instantly share code, notes, and snippets.

@BlackCetha
Last active March 16, 2026 19:18
Show Gist options
  • Select an option

  • Save BlackCetha/0ae81a05d07404c31c75 to your computer and use it in GitHub Desktop.

Select an option

Save BlackCetha/0ae81a05d07404c31c75 to your computer and use it in GitHub Desktop.
Null cancelling movement script (source games)
bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright
alias +mfwd "-back;+forward;alias checkfwd +forward;"
alias +mback "-forward;+back;alias checkback +back;"
alias +mleft "-moveright;+moveleft;alias checkleft +moveleft;"
alias +mright "-moveleft;+moveright;alias checkright +moveright;"
alias -mfwd "-forward;checkback;alias checkfwd none;"
alias -mback "-back;checkfwd;alias checkback none;"
alias -mleft "-moveleft;checkright;alias checkleft none;"
alias -mright "-moveright;checkleft;alias checkright none;"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""
bind "SPACE" "+jump"
bind "ctrl" "+duck"
@Alexeysey

Copy link
Copy Markdown

when i press a and d at the same time, it goes for another side(e.g. I hold a, then hold d and im going to right)
Any solution?

@augstsh

augstsh commented Jan 18, 2023

Copy link
Copy Markdown

thats the point lol

@victre151

Copy link
Copy Markdown

How would I enable this in games?

@Stratdan

Copy link
Copy Markdown

How would I enable this in games?

You need to make an autoexec.cfg file. Just google how to do that. Put this script inside of autoexec.cfg.

@victre151

Copy link
Copy Markdown

Thnx

@Hibee33

Hibee33 commented Jul 22, 2024

Copy link
Copy Markdown

strafe keys dont work :P

@xeoMe015

xeoMe015 commented Jul 22, 2024

Copy link
Copy Markdown

The strafe keybinds are adjusted, here is a new updated version.

bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright
 
alias +mfwd "-back;+forward;alias checkfwd +forward;"
alias +mback "-forward;+back;alias checkback +back;"
alias +mleft "-right;+left;alias checkleft +left;"
alias +mright "-left;+right;alias checkright +right;"
alias -mfwd "-forward;checkback;alias checkfwd none;"
alias -mback "-back;checkfwd;alias checkback none;"
alias -mleft "-left;checkright;alias checkleft none;"
alias -mright "-right;checkleft;alias checkright none;"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""

I did found one issue from my end which might not be related to the script but sometimes my input freezes so i'm moving a certain direction even though i've released all my keys.
Not sure where this is coming from so might need to download an overlay to see the actual inputs it is receiving.
Keyboard: Wooting 60HE

@Oduf

Oduf commented Jul 22, 2024

Copy link
Copy Markdown

The strafe keybinds are adjusted, here is a new updated version.

bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright
 
alias +mfwd "-back;+forward;alias checkfwd +forward;"
alias +mback "-forward;+back;alias checkback +back;"
alias +mleft "-right;+left;alias checkleft +left;"
alias +mright "-left;+right;alias checkright +right;"
alias -mfwd "-forward;checkback;alias checkfwd none;"
alias -mback "-back;checkfwd;alias checkback none;"
alias -mleft "-left;checkright;alias checkleft none;"
alias -mright "-right;checkleft;alias checkright none;"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""

I did found one issue from my end which might not be related to the script but sometimes my input freezes so i'm moving a certain direction even though i've released all my keys. Not sure where this is coming from so might need to download an overlay to see the actual inputs it is receiving. Keyboard: Wooting 60HE

I have exact same issue, have you figured it out?

@Ghost2229

Copy link
Copy Markdown

i have an problem my A and D keys are not working does anyone know why?

@xeoMe015

Copy link
Copy Markdown

i have an problem my A and D keys are not working does anyone know why?

See my post above, the keybinds are adjusted it's not moveright and moveleft anymore but right and left.
Make a null.cfg in this folder C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg
Enter all data from my quote above and save.

Go into CS and open console and type:
exec null.cfg

@MilanDean

MilanDean commented Jul 26, 2024

Copy link
Copy Markdown

i have an problem my A and D keys are not working does anyone know why?

See my post above, the keybinds are adjusted it's not moveright and moveleft anymore but right and left. Make a null.cfg in this folder C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg Enter all data from my quote above and save.

Go into CS and open console and type: exec null.cfg

This still doesnt work, as adjusting this is still causing unnecessary strafing from the previously used key. A more appropriate form of this would be something like this:

alias "go_forward" "-forward; +forward"
alias "go_back" "-back; +back"
alias "go_left" "-left; +left"
alias "go_right" "-right; +right"

alias "check_fwd" ""
alias "check_back" ""
alias "check_left" ""
alias "check_right" ""

alias "+mfwd" "-back; +forward; alias check_fwd go_forward"
alias "+mback" "-forward; +back; alias check_back go_back"
alias "+mleft" "-right; +left; alias check_left go_left"
alias "+mright" "-left; +right; alias check_right go_right"
alias "-mfwd" "-forward; check_back; alias check_fwd"
alias "-mback" "-back; check_fwd; alias check_back"
alias "-mleft" "-left; check_right; alias check_left"
alias "-mright" "-right; check_left; alias check_right"

bind w "+mfwd"
bind a "+mleft"
bind s "+mback"
bind d "+mright"

@xeoMe015

Copy link
Copy Markdown

i have an problem my A and D keys are not working does anyone know why?

See my post above, the keybinds are adjusted it's not moveright and moveleft anymore but right and left. Make a null.cfg in this folder C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg Enter all data from my quote above and save.
Go into CS and open console and type: exec null.cfg

This still doesnt work, as adjusting this still causing unnecessary strafing from the previously used key.

Never mentioned it fixed the frozen input.
If you want a fix use AHK script or buy any wooting or the razer huntsman v3 pro.

@MilanDean

MilanDean commented Jul 26, 2024

Copy link
Copy Markdown

i have an problem my A and D keys are not working does anyone know why?

See my post above, the keybinds are adjusted it's not moveright and moveleft anymore but right and left. Make a null.cfg in this folder C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo\cfg Enter all data from my quote above and save.
Go into CS and open console and type: exec null.cfg

This still doesnt work, as adjusting this still causing unnecessary strafing from the previously used key.

Never mentioned it fixed the frozen input. If you want a fix use AHK script or buy any wooting or the razer huntsman v3 pro.

I edited my comment and added the modified autoexec.cfg, this seems to work and handle the frozen input.

@Ritlomg3

Copy link
Copy Markdown

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment