This repository demonstrates how to use keyd to create a modifier layer for Counter-Strike 2 on Linux (tested on CachyOS). The goal is to bind grenade equip keys to WASD, allowing you to quickly equip grenades without taking your fingers off the movement keys.
While holding a mouse button (mouse2 on my mouse), the movement keys are temporarily remapped to function keys, which CS2 then binds to grenade slots.
Because the remapping happens outside the game, CS2 never has to rebind W, A, S, or D, avoiding the stuck movement issues that occur when using Source 2 aliases.
Note
By default, Steam uses F12 as the screenshot hotkey. If you bind F12 to a grenade, you'll probably want to change Steam's screenshot key to something else.
| Input | Sends | CS2 Action |
|---|---|---|
| Mouse2 + W | F9 | Flashbang |
| Mouse2 + A | F10 | HE Grenade |
| Mouse2 + S | F11 | Smoke |
| Mouse2 + D | F12 | Molotov / Incendiary |
- Linux (I use CachyOS)
keyd- Counter-Strike 2
sudo pacman -S keydEnable the service:
sudo systemctl enable --now keydCreate or edit:
/etc/keyd/default.conf
Use the following configuration:
[ids]
*
[main]
mouse2 = layer(nades)
[nades]
w = f9
a = f10
s = f11
d = f12Reload keyd:
sudo keyd reloadOr restart it:
sudo systemctl restart keydIf mouse2 doesn't work with your mouse, determine the correct button name by running:
sudo keyd monitorPress the desired mouse button and note the event name.
Replace mouse2 in the configuration with the name reported by keyd monitor.
Add the following to your autoexec.cfg:
bind "F9" "slot7" // Flashbang
bind "F10" "slot6" // HE Grenade
bind "F11" "slot8" // Smoke
bind "F12" "slot10" // Molotov / Incendiary
Typical Linux location:
~/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg/autoexec.cfg
Reload the configuration in-game:
exec autoexec
Source 2 does not reliably handle rebinding keys that use +/- commands (+forward, +left, etc.). This can lead to issues such as:
- Stuck movement
- Lost key releases
- Inconsistent behavior depending on the order keys are pressed
Using keyd avoids these problems entirely by remapping the keys before they ever reach the game.
You can change the function keys or grenade assignments however you'd like.
Example:
[nades]
w = f13
a = f14
s = f15
d = f16
Then update your CS2 binds accordingly.