If you’ve ever wanted to hold down a key to temporarily change the function of other keys in Counter-Strike 2, you’re in the right place. In this guide, I’ll show you how to use modifier keys (like Alt, Shift, or any other key) together with aliases to create flexible, pro-level keybinds.
Why Use Modifier Key Binds?
If you’re using an 80% or even 60% keyboard, you might find there simply aren’t enough keys for all your binds. For example, on my Logitech G Pro Rapid, I can manually assign new keys using modifiers — like turning F1 into F13 by holding the Fn key. But not every keyboard supports this kind of remapping.
Since I aim to create autoexec files that work for everyone, I’ve shifted away from relying on keyboard-specific features. Instead, I use CS2’s built-in modifier keys and aliases to achieve the same flexibility — and it works on any setup.
Here are a few more great reasons to use modifier keys and aliases:
-
Hold a modifier key to quickly buy or equip utility
-
Create alternate functions without using extra keys
-
Boost your speed and efficiency during clutches or fast rounds
Step-by-Step: Create a Modifier Bind in CS2
In this section, using example from my autoexec, I will describe how to create modifier key and assign different actions, based on the whether it is pressed or not.
1. Set Up the Modifier
I’ll use Mouse 3 as the modifier key in this example. When it’s held, the numeric keys (1, 2, 3 … 0) and my utility binds (Z, X, C, V) become buy binds. For example, pressing Z normally equips a Molotov or Incendiary, but combining Mouse 3 + Z will buy one in the buy zone at the start of the round.
To avoid overcluttering this guide, I’ll focus only on my custom grenade binds and the buy binds associated with them. You can find the rest of my buy bind code in the autoexec file linked here.
Step 1: Define Aliases for Standard and Modified Keys
If this is your first time encountering aliases in CS2, here’s a quick explanation: An alias is a custom command that lets you group or rename console commands.
You can name aliases however you like, but I recommend keeping them descriptive — for example, modKey for the modifier, and stdZ / modZ for the standard and modified actions tied to the Z key.
The + and – symbols before an alias are essential.
-
+modKey is triggered when the key is pressed.
-
-modKey is triggered when it’s released.
Inside the alias, you can write commands directly or reference other aliases — as we do here with modZ and stdZ.
Step 2: Bind the Modifier Key
Now we bind your chosen modifier key to activate the alternate functionality. In this case, I use Mouse 3, but you can use any key (like F1 or Caps Lock).
bind “MOUSE3” “+modKey”
alias “+modKey” “modZ; modX; modC; modV”
alias “-modKey” “stdZ; stdX; stdC; stdV”
-modKey
The last line here (-modKey) is important if you’re reloading your config or switching setups. It’s a good practice to include it — it ensures the current state of the modifier key resets to its standard behavior.
2. Define Your Standard and Modified Actions
Step 3: Define Standard Actions
It’s time to define aliases linked to “-modKey” in Step 2 above. Standard behavior, when the modifier key is not pressed.
Let’s examine the bind for Smoke Grenade / Healthshot / Demo X-Ray. This example specifically illustrates why two aliases are defined for each key, instead of just one. The reason lies in how the bind command handles multiple actions.
When the bind command is on the left side, you can assign multiple actions to a single key by wrapping them in quotation marks. However, when those actions are part of an alias (on the right side), you can’t wrap them in an additional set of quotes — so only the first action will be executed.
Take a look at these two commands:
- bind “X” “slot8; slot12; toggle spec_show_xray 0 1”
- alias “stdX” “bind X slot8; slot12; toggle spec_show_xray 0 1”
In the first example, pressing X will:
• Equip a Smoke Grenade (slot8) in Competitive mode
• Equip a Healthshot (slot12) in Deathmatch mode
• Toggle X-Ray in Demo Review mode
In the second example, only slot8 (Smoke Grenade) will be executed — the rest will be ignored, because multiple commands inside an alias can’t be parsed this way without proper structure.
You can overcome this limitation by creating a new alias that includes multiple actions, then binding your key to that alias. That’s exactly what I’ve done here.
Is this necessary for the other three grenades? Not really — but it keeps the code clean, consistent, and scalable.
Step 4: Define Modified Actions
In this step I bind actions while modifier button pressed.
For the same reason as the Smoke Grenade / Healthshot / Demo X-Ray bind, the Molotov buy bind requires an additional alias — while the others technically don’t, they still include one for the sake of code consistency.
If you’re looking to create CS2 buy binds, check out the CS2 Toolkit, which simplifies the entire process for you.
Final Result
Here is the quick description of the standard and modified actions bonded to Z, X, C and V keys in my setup.
| Key | Action |
|---|---|
| Z | Equip Molotov/Incendiary |
| MOUSE3 + Z | Buy Molotov/Incendiary |
| X | Equip Smoke or Healthshot / Toggle Demo X-Ray |
| MOUSE3 + X | Buy Smoke |
| C | Equip Flash |
| MOUSE3 + C | Buy Flash |
| V | Equip HE |
| MOUSE3 + V | Buy HE |
Organize in a Config File
Following my example, you can create your own standard and modified action and bind them to the same key. Then save everything into a custom config file (e.g., modbinds.cfg) and run it from your autoexec.cfg like this:
exec modbinds.cfg
💡 Bonus Tips
- You can apply the same logic to SHIFT, CTRL, or custom keys.
- Great for jump-throws, buy binds, or fast grenade access.
- Can be stacked into multiple layers if you’re brave 😅
