CS2 Mouse Fix
Introduction
Ever since I changed my monitor, I became unable to play Counter-Strike 2 (CS2) because the mouse click was completely invalid in the game. Because my operating system is Ubuntu instead of Windows, troubleshooting the problem could be even more challenging.
In this blog post, I would like to talk about how I fixed the mouse click invalid problem in CS2 in Ubuntu.
Problem Phenomenon
Previously, the resolution of my monitor was 2560 x 1440 (16:9). After I changed my monitor, the resolution became 3840 x 2560 (3:2).
The operating system I used was Ubuntu 24.04 LTS and the Steam client was installed as a snap package.
- When I started CS2, I could move the mouse cursor in the game, but I could not click anything.
- Probably because the new display aspect ratio was different from the old one, the graphics display in the game was weird.
Failed Fix Attempts
On Reddit, some people had mouse problems in CS2 (on Windows platforms) and the solutions suggested there were:
- Add
-console
to launch options for CS2 to so that the console could be invoked via pressing ~ in the game. - Invoke the console, type the command
bind mouse1 +attack
, and press Enter.
It did not work for me.
Successful Fix
Inspired by this YouTube video, which discussed the solutions for mouse problems in CS2 on Windows platforms, I realized that solution might also be applicable to Ubuntu with very some minor modifications. Essentially, the solutions discussed in the video were:
- Add
-console
to launch options for CS2. - Delete the
730
folder in the Steam user data directory. - Run the following commands in the console of CS2.
bind "X_AXIS" "rightleft"
bind "Y_AXIS" "!forwardback"
bind "MOUSE_X" "yaw"
bind "MOUSE_Y" "pitch"
bind "U_AXIS" "yaw"
bind "R_AXIS" "pitch"
In my case on Ubuntu 24.04 LTS, the 730
folder was also present in the Steam user data directory. I deleted the 730
folder and restarted CS2 without even having to run the commands in the console. The mouse click problem was fixed and the graphics display became normal.
Specifically, in my case, the 730
folder was located at ~/snap/steam/common/.steam/steam/userdata/xxxxxxxxx/730/
. The xxxxxxxxx
was the user ID of my Steam account and usually there is only one folder under userdata
.
1 | $ ls ~/snap/steam/common/.steam/steam/userdata/xxxxxxxxx |
Conclusions
At first, I though because the display aspect ratio of 3:2 for my new monitor was rare, the problem was probably due to CS2 does not support the aspect ratio at all and thus the mouse problem could probably never be fixed. In fact, I did find some discussions about why CS2 does not support 3:2 aspect ratio on the Internet.
However, after I fixed the mouse problem, I tried playing the game with the native resolution of 3840 x 2560 (3:2) and the game worked perfectly.
In retrospect, the mouse problem was due to the 730
folder cached the older display settings and the mouse settings. By deleting the 730
folder, the game could reinitialize the display settings and the mouse settings, and the mouse problem was fixed.
CS2 Mouse Fix