Alright, let’s talk about Half-Life 2 and that darn sprint key. For years, I played it holding down SHIFT like a madman. My pinky finger, man, it was not happy. I always thought, there’s gotta be a better way. I just want to tap it once and run, tap it again and walk. You know, like a toggle.

So, one afternoon, I decided enough was enough. I started digging around. First thing I remembered was the developer console. You gotta enable that, usually. I think I went into the game’s launch options on Steam and added something like -console. Or maybe it was just a setting in the keyboard options, “Advanced” section, to enable it. Anyway, once that’s sorted, you hit the tilde key, that’s the little `~` key, usually below Escape. And this grey box pops up. That’s your command center.
I figured I’d need to use the bind command. That much was obvious. But just binding SHIFT to `+sprint` wasn’t gonna cut it, ’cause that’s the default hold-to-sprint behavior. I needed it to stick.
Then I stumbled upon alias commands. Now we’re talking! With aliases, you can basically make your own little mini-commands, or even string a few commands together. This was the key to making a toggle work.
So, I started piecing things together in my head, then tried typing them into the console. It took a bit of fiddling, believe me. My first few tries were a bit of a mess. But eventually, I got a working setup. It looked something like this, conceptually:
I needed two states: one for turning sprint ON, and one for turning sprint OFF.

When I press SHIFT and sprint is OFF, it should turn ON sprint and change the SHIFT key’s job to “turn sprint OFF next time.”
When I press SHIFT and sprint is ON, it should turn OFF sprint and change the SHIFT key’s job back to “turn sprint ON next time.”
So, in the console, I worked out these lines:
First, I made an alias to start sprinting and set up the next press to stop sprinting. Something like:

alias "sprint_start" "+sprint; alias "toggle_sprint" "sprint_stop""
Then, an alias to stop sprinting and set up the next press to start sprinting again:
alias "sprint_stop" "-sprint; alias "toggle_sprint" "sprint_start""
And to kick things off, I made sure `toggle_sprint` initially points to `sprint_start`:
alias "toggle_sprint" "sprint_start"

Finally, I bound my SHIFT key to this `toggle_sprint` alias:
bind "SHIFT" "toggle_sprint"
I typed all that into the console, and boom! It worked. Tapped SHIFT, Gordon started running. Tapped SHIFT again, he went back to walking. Beautiful.
But here’s the kicker: if you type that into the console, it’s gone next time you start the game. Who wants to do that every single time? Not me.
So, the final piece of the puzzle was the file. This is a special configuration file that Half-Life 2 (and other Source games) will run automatically every time the game starts. I had to go into my Half-Life 2 game folder, specifically into the `hl2/cfg` directory. For me, it was something like `Steam/steamapps/common/Half-Life 2/hl2/cfg/`.

If you don’t have an `*` file there, you just make one. A simple text file. Then, I just pasted those lines of code into it:
alias "sprint_start" "+sprint; alias "toggle_sprint" "sprint_stop"
alias "sprint_stop" "-sprint; alias "toggle_sprint" "sprint_start"
alias "toggle_sprint" "sprint_start"
bind "SHIFT" "toggle_sprint"

(Actually, I might have used slightly different names for my aliases, like `ena_sprint` and `dis_sprint`, but the logic is the same.)
Saved the file. Launched Half-Life 2. And there it was. Permanent toggle sprint. No more console typing every time. Just tap SHIFT to run, tap to walk. My gaming life, or at least my Half-Life 2 sessions, got a little bit comfier. It’s a small thing, but man, it makes a difference on those long treks through City 17.