Skip to content

Instantly share code, notes, and snippets.

@p3nj
Created December 22, 2025 06:05
Show Gist options
  • Select an option

  • Save p3nj/94093f3c7db8b0f2faf11a1c2869a4c5 to your computer and use it in GitHub Desktop.

Select an option

Save p3nj/94093f3c7db8b0f2faf11a1c2869a4c5 to your computer and use it in GitHub Desktop.
Fix for CS 1.6 / Half-Life (Steam Legacy) mouse wheel triggering MOUSE4/MOUSE5 on Linux. Replace bundled SDL2 with system library.

Fix CS 1.6 / Half-Life Mouse Wheel Bug on Linux [steam_legacy]

Problem

On modern Linux distributions (Fedora, Arch, Ubuntu 22.04+, etc.), Counter-Strike 1.6 and other GoldSrc games have a mouse wheel bug where:

  • MWHEELDOWN triggers both scroll down AND MOUSE5
  • MWHEELUP triggers both scroll up AND MOUSE4

This causes issues like:

  • Sound cutting out briefly when bunny hopping with bind MWHEELDOWN +jump
  • Unwanted +use sounds when scrolling (if MOUSE4 is bound)
  • General erratic mouse wheel behavior

Note: Setting SDL_VIDEODRIVER=x11 does NOT fix this issue.

Cause

Half-Life ships with an ancient bundled libSDL2-2.0.so.0 library from ~2013 that predates the SDL2 mouse wheel input fixes.

Solution

Replace the bundled SDL2 library with a symlink to your system's 32-bit SDL2.

Prerequisites

Ensure you have 32-bit SDL2 installed:

# Fedora
sudo dnf install SDL2.i686

# Arch Linux
sudo pacman -S lib32-sdl2

# Ubuntu/Debian
sudo apt install libsdl2-2.0-0:i386

# openSUSE
sudo zypper install libSDL2-2_0-0-32bit

Fix Steps

cd ~/.local/share/Steam/steamapps/common/Half-Life/

# Backup the old library
mv libSDL2-2.0.so.0 libSDL2-2.0.so.0.bak

# Create symlink to system's 32-bit SDL2
ln -s /usr/lib/libSDL2-2.0.so.0 libSDL2-2.0.so.0

Verify

ls -la libSDL2-2.0.so.0
# Should show: libSDL2-2.0.so.0 -> /usr/lib/libSDL2-2.0.so.0

Why Symlink Instead of Delete?

Steam's "Verify integrity of game files" feature will re-download deleted files. A symlink preserves the expected file path while using your system's updated library.

Additional Fixes You May Need

On very modern Linux systems (Fedora 40+, etc.), you may also need to remove bundled C++ libraries that cause CXXABI or GCC_7.0.0 errors:

cd ~/.local/share/Steam/steamapps/common/Half-Life/

# Backup and remove old C++ runtime libraries
mv libstdc++.so.6 libstdc++.so.6.bak
mv libgcc_s.so.1 libgcc_s.so.1.bak

Reverting

To restore original behavior:

cd ~/.local/share/Steam/steamapps/common/Half-Life/

rm libSDL2-2.0.so.0
mv libSDL2-2.0.so.0.bak libSDL2-2.0.so.0

# If you also removed C++ libraries:
mv libstdc++.so.6.bak libstdc++.so.6
mv libgcc_s.so.1.bak libgcc_s.so.1

References

Tested On

  • Fedora 43 (Kernel 6.17)
  • Should work on any modern Linux distribution with 32-bit SDL2 available

Last updated: December 2025

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