Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[Linux] Unable to aim towards top-left corner with mouse #44
Comments
sebth
commented
Sep 23, 2014
|
I tried playing without any window manager running, and the problem persists, so it has nothing to do with 'awesome'. |
sebth
commented
Sep 24, 2014
|
It seems like CS:GO ignores relative SDL_MOUSEMOTION events with mouse position (0, 0). I've managed to work around this bug by patching SDL2 to clamp the mouse to x > 0 when it is in relative mode. |
thatarchguy
commented
Jan 24, 2015
|
I am having a problem similar. When I look top left, my sensitivity drops almost in half. I noticed this on a few maps where I had to look up and to the left, like going into boiler on inferno map. I run Arch with AwesomeWM |
fallore
commented
Jul 26, 2015
|
@sebth any chance youre still around to explain your workaround? i have no idea how to do what you mentioned |
sebth
commented
Aug 5, 2015
|
This problem disappeared for me when I upgraded from Debian 7 to Debian 8. I haven't tried to figure out what could've caused the behaviour to change, but this is the patch I used: diff -ru SDL2-2.0.3/src/events/SDL_mouse.c SDL2-2.0.3.fix/src/events/SDL_mouse.c
--- SDL2-2.0.3/src/events/SDL_mouse.c 2014-03-16 03:31:44.000000000 +0100
+++ SDL2-2.0.3.fix/src/events/SDL_mouse.c 2014-09-24 16:10:19.000000000 +0200
@@ -238,31 +238,33 @@
}
/* Update internal mouse coordinates */
- if (!mouse->relative_mode) {
- mouse->x = x;
- mouse->y = y;
- } else {
- mouse->x += xrel;
- mouse->y += yrel;
- }
+ if (!relative) {
+ if (!mouse->relative_mode) {
+ mouse->x = x;
+ mouse->y = y;
+ } else {
+ mouse->x += xrel;
+ mouse->y += yrel;
+ }
- SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
- --x_max;
- --y_max;
+ SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
+ --x_max;
+ --y_max;
- /* make sure that the pointers find themselves inside the windows */
- if (mouse->x > x_max) {
- mouse->x = x_max;
- }
- if (mouse->x < 0) {
- mouse->x = 0;
- }
+ /* make sure that the pointers find themselves inside the windows */
+ if (mouse->x > x_max) {
+ mouse->x = x_max;
+ }
+ if (mouse->x < 0) {
+ mouse->x = 0;
+ }
- if (mouse->y > y_max) {
- mouse->y = y_max;
- }
- if (mouse->y < 0) {
- mouse->y = 0;
+ if (mouse->y > y_max) {
+ mouse->y = y_max;
+ }
+ if (mouse->y < 0) {
+ mouse->y = 0;
+ }
}
mouse->xdelta += xrel;Basically it stops the updating of mouse coordinates when the mouse is set to relative mode. This prevents the mouse from getting to coordinates (0, 0) when in-game. I guess you could also modify the statements under So, to get CS:GO to use this, just get the SDL2 source code (https://www.libsdl.org/release/SDL2-2.0.3.tar.gz), patch it with the patch above, and build it. You don't need to install the library as we are going to preload it. Remember to build it as a 32-bit library even if you're on a 64-bit system, as CS:GO is 32-bit. (If you need help on how to patch and build an open source project, there are many good guides on the web if you search for it.) After you've built the library, right click on CS:GO in your Steam games list, choose Properties, and then Set Launch Options. Use this as your Launch Options: |
sebth
referenced this issue
Aug 6, 2015
Closed
[Linux] Mouse is slower in one direction than all others #405
ggnolife
commented
Aug 6, 2015
|
Make sure you do "CFLAGS='-m32 -O2' LDFLAGS=-m32 ./configure --build=i686-pc-linux-gnu" before you build it so it builds as 32bit! |
davidw-valve
added
the
Reviewed
label
Aug 11, 2015
davidw-valve
self-assigned this
Aug 11, 2015
|
I am trying to work out this issue but am not having much luck reproducing it so far. For people it occurs for, does it occur for other Source FPS games, such as TF2 or Portal 2? (Dota2 uses very different mouse code so isn't a good comparison point). |
fallore
commented
Aug 11, 2015
|
So, I am having the version of the problem where my sensitivity is cut in half (approximately) when I move my view up and left, not that it stops altogether. I tried on TF2 and it seems to be completely fine. I don't have portal 2 installed nor time to test it at the moment, unfortunately. I've posted my specs and specific problem in #405 |
sebth
commented
Aug 12, 2015
|
The Source FPSes I have are CS:GO and Half-Life 2. When I was running Debian 7, I only had this problem in CS:GO, not in Half-Life 2. |
coffee-lord
commented
Aug 16, 2015
|
@davidw-valve sebth's patch seems to have solved the problem for me. Tested Portal 2 - works fine as it is. |
fallore
commented
Aug 17, 2015
|
@coffee-lord were you having sebth's version of the problem where you couldn't aim up and to the left at all, or mine where your sensitivity in that direction was halved? do you think you could upload your patched SDL? i am having no luck changing and building mine on my own. |
fallore
commented
Aug 17, 2015
|
so i finally figured out how to correctly build the directory with the patched mouse file and can confirm that this problem is different than mine in #405 or at least that it did not solve it for me, if that's any help to you @davidw-valve |
coffee-lord
commented
Aug 17, 2015
|
@fallore in my case the problem was halved sensitivity when moving towards upper left corner. Initially i tried different polling rates for mouse (125,500,1000 Hz) and found that this issue had gotten worse when the polling rate was low (125 Hz). I might be wrong though. are you sure that the lib's preloaded correctly? it has to be 32 bit. i think the game will still launch if the lib's 64 bit but the fix won't work. |
fallore
commented
Aug 17, 2015
|
@coffee-lord is there a way to check if i built the directory correctly, or if csgo is loading it correctly? i used the flags to make it 32 bit, or at least received no error when i input them before the ./configure and make commands. these are the commands i used: 153 CFLAGS='-m32 -O2' i made the correct changes to the mouse.c file before i built it, and i received no errors when i built it. my launch option is thus "LD_PRELOAD=/home/fallore/SDL2-2.0.3/build/.libs/libSDL2-2.0.so.0 %command% -freq 144 -novid -console " i also tried it without the -freq 144 etc commands to see if that was the problem any other info i can share that might enlighten why this did not work for me? |
coffee-lord
commented
Aug 18, 2015
|
@fallore what does the |
fallore
commented
Aug 19, 2015
|
@coffee-lord i'm unable to open it in text editor. it tells me it doesn't detect the character encoding? how do i check? |
coffee-lord
commented
Aug 19, 2015
|
@fallore no it's a tool called
|
fallore
commented
Aug 23, 2015
|
so file does show it linked to the proper file (file libSDL2-2.0.so.0 libSDL2-2.0.so.0: symbolic link to `libSDL2-2.0.so.0.2.1' ), but when i put the launch option CSGO wont start. i'm pretty lost at this point :( i was able to find this error log if anyone can tell me what it means/what i need to do |
coffee-lord
commented
Aug 24, 2015
|
@fallore
instead of
I'm talking out of my ass here but it might be still worth to try it. |
sebth
commented
Aug 26, 2015
|
@fallore @coffee-lord CFLAGS='-m32 -O2'
LDFLAGS=-m32
./configure --build=i686-pc-linux-gnuis wrong. If you don't type CFLAGS='-m32 -O2' LDFLAGS=-m32 ./configure --build=i686-pc-linux-gnuor export CFLAGS='-m32 -O2'
export LDFLAGS=-m32
./configure --build=i686-pc-linux-gnu. To see which libSDL CS:GO is using, you can run |
coffee-lord
referenced this issue
Jan 8, 2016
Closed
1/7/2016 Update significantly shifts mouse sensitivity value #574
ahnook
commented
Jan 9, 2016
|
I've uploaded a video demonstrating steps to reproduce this bug. While testing, I discovered that mouse DPI makes a huge difference on whether or not you'll trigger this bug under normal gameplay. Higher DPI means a higher chance of the cursor going into the top left corner, which causes the issue. I myself played for a whole year with 400 DPI and I had never triggered this bug before, but as soon as I raised it while playing around with my DPI+sensitivity due to the 2016-01-07 update, I immediately ran into it. I suspect this might be the reason why some people have always had trouble with this, while others have never experienced it, especially considering how popular 400 DPI is in CS:GO. I also wonder if this might be the reason why @davidw-valve has been unable to reproduce it so far. I can confirm that @sebth's patch fixes the issue, however it also causes my cursor to stop working if I press escape in game to access the menu, as I do in the video above. Because of this, I used instead the following patch, which prevents the cursor from going into the (0,0) position by warping it to (1,0). diff -drp -u10 SDL2-2.0.4.orig/src/events/SDL_mouse.c SDL2-2.0.4/src/events/SDL_mouse.c
--- SDL2-2.0.4.orig/src/events/SDL_mouse.c 2016-01-02 17:56:31.000000000 -0200
+++ SDL2-2.0.4/src/events/SDL_mouse.c 2016-01-08 16:43:48.590681755 -0200
@@ -261,20 +261,24 @@ SDL_PrivateSendMouseMotion(SDL_Window *
if (mouse->x < 0) {
mouse->x = 0;
}
if (mouse->y > y_max) {
mouse->y = y_max;
}
if (mouse->y < 0) {
mouse->y = 0;
}
+
+ if (relative && mouse->x == 0 && mouse->y == 0) {
+ mouse->x = 1;
+ }
}
mouse->xdelta += xrel;
mouse->ydelta += yrel;
/* Move the mouse cursor, if needed */
if (mouse->cursor_shown && !mouse->relative_mode &&
mouse->MoveCursor && mouse->cur_cursor) {
mouse->MoveCursor(mouse->cur_cursor);
}Some extra info:
|
JoshuaMurphynz
commented
Jan 9, 2016
|
Works fine in the buy menu. Just in game is broken
|
andras-kiss
commented
Jan 9, 2016
|
Just tested @ahnook 's patch with 2.0.4, it works. Corner bug gone. But I think I will use the valve version, I'm too worried about a VAC ban. |
AnAkkk
commented
Jan 9, 2016
|
You can simply use the SDL in built feature to load another SDL version: export SDL_DYNAMIC_API=/path to other sdl |
BeniaminK
commented
Jan 10, 2016
|
@ahnook How did you test this script? I already built the libSDL, placed it in the ~/.steam/steamapps/common/Counter-Strike Global Offensive/bin folder replacing the old libSDL2-2.0.so.0 library (I added some additional debugging to see, whether this file is used) and as I see, the game doesn't load this library. Could you provide more information what should I do to make it work? export SDL_DYNAMIC_API= - this doesn't work neither |
ahnook
commented
Jan 10, 2016
|
@BeniaminK I used LD_PRELOAD in csgo's launch options, as described by @sebth in his comment above where he posted his own patch. Here's a step by step of the whole process, since I saw others also having trouble testing this.
mkdir ~/libsdl
cd ~/libsdl
wget 'https://www.libsdl.org/release/SDL2-2.0.4.tar.gz'
tar xvzf SDL2-2.0.4.tar.gz
wget 'http://pastie.org/pastes/10680849/download' -O sdl_0x0.patch
patch -p0 < sdl_0x0.patch
cd SDL2-2.0.4
CFLAGS='-m32 -O2' LDFLAGS=-m32 ./configure --build=i686-pc-linux-gnu
make
If you already have %command% in there, then don't duplicate it, just prepend the LD_PRELOAD part. Remember to click OK to save your changes.
lsof -p `pidof csgo_linux` | grep libSDLIf all went well, you should see a line ending in the path to your patched lib. If not, you will see the path to some other copy of the lib in your system. Note that it is critical that you compile the lib for 32-bit and also that LD_PRELOAD points correctly to it, without any typos. Finally, if you want to go back to valve's copy of the lib at any time, just edit the launch options again and remove the LD_PRELOAD part. I hope this helps. |
carbn
commented
Jan 12, 2016
|
I've successfully worked around this issue by lowering my mouse DPI from 1600 to 400 and setting my sensitivity to 4x. With 1600 DPI the game is almost unplayable, but with 400 the bug is not even noticeable. The only problem is that buying using the mouse is a bit awkward as the cursor speed is super slow. I'd still prefer to have 1600 DPI in-game as I use it also on the desktop. |
btegs
commented
Jan 12, 2016
|
@carbn - 1600 DPI is pretty high for this game. Most pros put their DPI at something like 400 or 450 DPI and then adjust the in-game sensitivity to achieve an ideal "real sensitivity" between 800 and 1000. |
rtuovine
commented
Jan 16, 2016
|
I am able to reproduce the bug the same way as in ahnook's video above. SDL version is, using
and my system information is here. I was not able to compile and link another version, as was also suggested by ahnook. When writing
which (I think) is because this libts is not compatible with 64 bit. I couldn't find a way around this (except tweaking the DPI and sensitivity so that the bug isn't so noticeable). |
ahnook
commented
Jan 17, 2016
|
@rtuovine maybe try configuring with I've experimented with this bug some more and discovered that, while mouse DPI greatly affects whether the cursor will move into the top left corner and trigger the bug, in-game FPS will greatly affect how much the crosshair will be decelerated once the bug is triggered. I've uploaded a video demonstrating this effect. At 60 FPS, the deceleration is so slight I can only tell it is happening by attempting to repeatedly move the mouse up-left and down-right between the same two points (at first there seems to be no deceleration, but after enough iterations, the crosshair visibly drifts towards the bottom right corner). On the other hand, at 700+ FPS, the deceleration is so great that I can barely move the crosshair at all, even while quickly dragging my mouse all the way across the mousepad. In conclusion, people trying to reproduce this bug should reduce video quality settings and uncap their framerate before attempting the reproduction, while people trying to minimize the effects of the bug during normal gameplay should cap their framerate with fps_max to as low a value as possible (in addition to reducing their mouse DPI as already suggested above). |
This was referenced Jan 22, 2016
zikkAbdelaziz
commented
Jan 23, 2016
ramyD
commented
Jan 24, 2016
|
Just wanted to add that this is the configure line that actually worked for me:
|
zikkAbdelaziz
commented
Jan 24, 2016
|
@ramyD I tried you configure method, it wouldn't compile afterward with it. |
hasufell
commented
Jan 24, 2016
|
I can't believe that a bug that breaks mouse behavior has been unfixed since September 2014. Are you serious valve? |
zikkAbdelaziz
commented
Jan 24, 2016
|
Makes me wonder, it seems that Stattrak music kits are a more important thing to be focusing on! |
andras-kiss
commented
Jan 24, 2016
|
@thedoctorz Well yeah. That's a big part of the income/profit that keeps cs:go going. I would say that's a great thing that people are buying these skins, and Valve is smart enough to focus on these. Would be great though if they fixed issues like this and the sound-loop bug which is even more annoying. |
zikkAbdelaziz
commented
Jan 24, 2016
|
This fix seems so easy to make, that i just don't understand how are they still delaying it or something ? |
hasufell
commented
Jan 24, 2016
There's nothing smart about not fixing important bugs. It upsets customers. |
andras-kiss
commented
Jan 24, 2016
|
@hasufell Most people don't notice it and most people who notice it don't care. If you have finite resources, you need to prioritize. Look how many people are concerned with this bug, and how many are with skins... Don't get me wrong: I also consider fixing gamebreaking bugs more important than silly skins. But there is a bigger picture. You need stupid people to buy skins in order to continue develping the game. This bug WILL be fixed. And guess where the money will come from to employ the developer |
hasufell
commented
Jan 24, 2016
|
@andras-kiss I don't need a lecture on valves business model. And I don't care at all where their money comes from. I'm a customer and I care about bugs getting fixed in a resaonble timeframe. This timeframe is not reasonable. Period. |
andras-kiss
commented
Jan 24, 2016
|
@hasufell You can fix it yourself. ahnook's patch works. |
hasufell
commented
Jan 24, 2016
|
That is wrong. It's not an SDL bug. And I am not interested in getting VAC banned by hacking on libraries. |
andras-kiss
commented
Jan 24, 2016
|
@hasufell Yeah that's true. Let's hope Valve fixes it soon. |
ramyD
commented
Jan 24, 2016
|
Hey everyone, could we please keep the discussion on topic and not pollute the bug thread with opinions? @thedoctorz Could you paste the result of the ./configure line (before typing "make"). Here is what mine looks like. If SDL is not compiling then it's definitively not going to work when running CSGO. Also, what version of linux are you running?
|
hasufell
commented
Jan 24, 2016
Posting hacks that may get you VAC banned in a bug report thread isn't much more ontopic. This has to be fixed by valve. If you think this is an SDL bug (pretty unlikely), post it on the SDL bug tracker: https://bugzilla.libsdl.org/ |
zikkAbdelaziz
commented
Jan 24, 2016
|
@ramyD, I get this:
Building Shared Libraries |
ramyD
commented
Jan 24, 2016
|
what distro?, Ubuntu? |
zikkAbdelaziz
commented
Jan 24, 2016
|
Ah sorry, Forgot |
ramyD
commented
Jan 24, 2016
|
Ok then I'm not sure what kind of window system you're using since openSUSE has an experimental support for wayland. Please post your system information as described in the readme of this project. The error you're getting when launching CSGO "SDL_Init(SDL_INIT_VIDEO) failed: No available video device" happens when the SDL lib you compiled doesn't find where to output the video - I had this exact error and noticed that it wasn't detecting my x11 libs, hence my post for the config. I'm unsure if you're on another window compositor or if you're simply missing xorg-dev libs. I'll get a better idea after you post your system information |
zikkAbdelaziz
commented
Jan 24, 2016
|
@ramyD |
ramyD
commented
Jan 24, 2016
|
@thedoctorz sorry to bum you out but your problem is not plain enough for me to see and I don't have experience with opensuse to help you out. |
zikkAbdelaziz
commented
Jan 24, 2016
|
@ramyD It's alright man, it is not for you to fix in the first place anyway. |
micb25
commented
Jan 24, 2016
|
Please fix that bug ASAP since it's known for a long time and the solution is easy (ship the updated SDL library). This is a game breaking bug and we lost at least two rounds at Dreamhack Leipzig because of it. Imagine the following situation: as a CT on de_dust2 defusing the bomb on A spot you are not able to defend yourself when a T is coming ramp. |
ramyD
commented
Jan 24, 2016
|
@micb25 this issue isn't caused by SDL, it's just worked around by changing SDL code. Bug is still in csgo software. |
|
We have a fix to this that we expect to ship in the next CS:GO update. |
Andygmb
commented
Jan 25, 2016
|
@davidw-valve Thank god. I have been unable to play CSGO since about a month ago when an update triggered this bug for me. |
ahnook
commented
Jan 26, 2016
|
@davidw-valve That's great news. Thank you for your hard work. |
jeifour
commented
Jan 26, 2016
|
@davidw-valve Wish I could buy you a beer for this. Well, guess I'll get a key instead. |
Toqozz
commented
Jan 28, 2016
|
@davidw-valve Thank you very much. |
ahnook
commented
Jan 28, 2016
|
I just tested the new update and I can confirm that it fixes this issue. |
micb25
commented
Jan 29, 2016
|
I can also confirm that the update solved the issue for me. |
zikkAbdelaziz
commented
Jan 30, 2016
|
Issue fix at last. |
nanno
commented
Feb 1, 2016
|
@sebth I think you can close this issue now |
sebth commentedSep 23, 2014
When aiming towards the top-left corner with the mouse in-game (both offline and online), the view stops moving. I'm able to aim in all directions except diagonally towards the top-left corner. This happens both in fullscreen and in windowed mode, no matter how fast or slow I move the mouse, altough the mouse is allowed to travel a small distance before the view stops moving. Disabling raw mouse input doesn't help.
The distance the mouse is allowed to travel before the view stops moving seems to depend on the resolution / window size: the problem is more apparent with a low resolution and a low mouse sensitivity.
System information output from Steam:
(My mouse is a standard USB mouse which uses the evdev driver; nothing special. It works fine in other games like Counter-Strike 1.6 and Quake 3.)