Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CS2 Grenade Modifier Layer with keyd

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.

Key Layout

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

Requirements

  • Linux (I use CachyOS)
  • keyd
  • Counter-Strike 2

Installing keyd

sudo pacman -S keyd

Enable the service:

sudo systemctl enable --now keyd

keyd Configuration

Create or edit:

/etc/keyd/default.conf

Use the following configuration:

[ids]
*

[main]
mouse2 = layer(nades)

[nades]
w = f9
a = f10
s = f11
d = f12

Reload keyd:

sudo keyd reload

Or restart it:

sudo systemctl restart keyd

Finding Your Mouse Button

If mouse2 doesn't work with your mouse, determine the correct button name by running:

sudo keyd monitor

Press the desired mouse button and note the event name.

Replace mouse2 in the configuration with the name reported by keyd monitor.

CS2 Configuration

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

Why Use keyd?

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.

Customization

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.

About

CS2 Files

Topics

Resources

Stars

Watchers

Forks

Contributors