ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.18k stars 173 forks source link

Shift key remains pressed after losing focus #3451

Closed tkerber closed 1 year ago

tkerber commented 9 years ago

If the shift key is pressed when steam loses focus, and released before it regains focus (e.g. a key combination including shift which moves windows around), steam behaves as though the key was never released.

The result is that clicking on games in the library results in multiple games being selected instead of the desired game, and clicking on links opens them in a new window.

Problem also occurs to a lesser extent with the control key.

ghost commented 9 years ago

This can be pretty annoying, started this Reddit thread about it:

http://www.reddit.com/r/linux_gaming/comments/2eqau8/steam_client_randomly_acting_like_the_shift_key/

Why would Steam be listening to commands in a method different from other apps? Or is this something annoying with Xorg, and the reason other apps don't seem to have the issue is because they use GTK or Qt or something which takes care of this problem for them?

LiamDawe commented 9 years ago

I think an issue I have is similar. If you click the middle mouse button inside a page it will stop anything else being clicked on until I do a right click to bring up a menu on the page.

Something is odd with the input that's for sure.

ghost commented 9 years ago

@liamdawe: Woah, so THAT is what that problem was! I had this happen to me twice and it was very annoying, I thought Cinnamon/Muffin broke, you cannot focus any other window after center-clicking in Steam, but yes right clicking on Steam afterwards will fix it.

Freaky! Why is Steam having such a hard time acting as a native normal app? Maybe it is trying to paste the contents of a clipboard but is failing to do so? (I love highlight then center-mouse-click to paste stuff instead of using control-C/V, I hope Steam gets this ability added as well)

LiamDawe commented 9 years ago

I'm going to guess on Windows it gives you that middle-click quick scrolling ability which is left in and broken on Linux?

Either way it's a bug. And I probably should have reported this sooner...

ghost commented 9 years ago

@liamdawe I waited for a while to report mine because I wasn't sure if it was my keyboard or something else until I did enough testing and playing around with Steam and other programs.

Better late than never! XD Also I wonder if it should get a separate bug report to bring it more visibility, hmmm.

ghost commented 9 years ago

Oh also I tried out the beta channel for the Steam client and all bugs exist in it as well.

ghost commented 9 years ago

I just confirmed a huge cause of this shift-key-stuck problem. In the Steam forum comment box, if you type a capital letter or any other character with shift, shift will get "stuck down" until you type another character. You can verify this by clicking with the mouse after you type a shifted character and seeing it highlight what you just typed.

kefkf commented 9 years ago

My scale windows keybinding has the shift key in it so everytime I switch to the steam window the shift key remains pressed. When I click on a game it selects multiple games, clicking on a link opens it in a new steam browser window etc.

ghost commented 9 years ago

Yep, can confirm the same thing, still no fix for this bug, it's pretty annoying. :P

sizeofbool commented 9 years ago

This bug is affecting me as well. OS: Debian 8 GNU\Linux (jessie) x86_64 Desktop Environment: xfce4 Display Manager: LightDM

ghost commented 8 years ago

Is there any kind of workaround for this? Ctrl and Shift gets constantly "stuck" when using steam overlay. It's really annoying bug.

Oh yes, in case it matters, i use Gnome 3.18 and Cinnamon 2.6.

sizeofbool commented 8 years ago

I've changed Steam In-Game Overlay key to "F4" to workaround this issue. I got used to it and found it more convenient to use.

duck57 commented 8 years ago

I'm pretty sure this is the same bug I run into when using Steam under Mac OS. Very annoying. There is absolutely no excuse for this to have been an issue in the first place.

ljrk0 commented 8 years ago

It's still there but you can basically just press shift again and exit the focus and everything is ok again.

ghost commented 8 years ago

Chalk me up, as well.

Running Fedora 23 64bit with LXDE.

For me pressing right shift then left shift seems to "release" it.

Cynerd commented 8 years ago

Happens to me all the time, when I move steam window to other virtual desktop by shortcut with shift in i3. This is really annoying. Pressing shift again fixes it, but I hate seconds when my mind doesn't known what is happening.

Anyway I think that steam client is storing key for shift and other modifier keys in some internal variable. They should reset all states when they get FocusOut event. Or better check state in X of these keys on every key press. I don't know what library they use to communicate with X, but don't tell me that it is too hard to fix this.

aereek commented 8 years ago

Still happens when i using Shift button. Fedora 24 64-bit, Gnome Shell.

MikkyX commented 7 years ago

I get this issue on macOS as well. If I open Steam, go away and do something else, every game I click on is added to selection as if I have Ctrl / Cmd held down. I have to roll my fingers across Ctrl / Cmd / Option to make it behave properly.

kaadmy commented 6 years ago

Getting this issue on Arch Linux with i3wm, it's annoying but I can deal with it. Is any fix going to happen any time soon?

nightsky30 commented 5 years ago

Seeing this as well with the latest Steam Client Beta.

Rabcor commented 5 years ago

4 years and we still have this issue. I'm getting it on manjaro, xfce.

AlexTu2 commented 5 years ago

Hmm, Still happening. Arch Linux 4.20.12 I3-gaps Pressing shift again temporarily solved this issue

chutchatut commented 5 years ago

Still happening Ubuntu 18.10

Rabcor commented 5 years ago

I noticed that in my case this was happening because of a macro/key combination I used to switch desktops, e.g. if I switched to/from the desktop steam is on with my keybinds I got this issue, but if I used the mouse I didn't.

Digging a little deeper I found that it was the key combination, I can't remember exactly what combination it was (something like ctrl+shift+f1-f6 or alt+shift+f1-f6) but after changing it to not use shift in the combination for switching desktops, I no longer have this issue.

ghost commented 5 years ago

Also getting this on NixOS

h1z1 commented 5 years ago

Weird,, though this ticket goes back quite a long time I've only noticed it after the last update-ish. Shift most certainly is not being held down, the only "fix" I've found is restarting steam. Doesn't happen all the time either.

naanlizard commented 4 years ago

Getting this on ubuntu 18.04, nvidia drivers

szmarczak commented 4 years ago

The issue is easy to reproduce:

Peek 2019-11-16 20-43

szmarczak commented 4 years ago

It also happens when switching from CS:GO to Steam Chat (through shift tab).

winny- commented 4 years ago

Happening on Gentoo using xfce4, easy to highlight entire web pages in the steam browser on accident.

System information

arrowgent commented 4 years ago

long time issue?

wanted to report and/or find a fix for this

this did not always happen, now it seems to be a common problem.

the main problem being that the rest of the UI is unresponsive with "shift" being held down

sizeofbool commented 4 years ago

I suspect this is a problem with (some?) X server\window managers, because I get similar "Shift key" and scrolling problems with other GUI apps like Firefox and text editors, so Steam Client is not the root cause for this behavior. Probably, this is why this issue is taking so long to be fixed.

szmarczak commented 4 years ago

I suspect this is a problem with (some?) X server\window managers, because I get similar "Shift key" and scrolling problems with other GUI apps like Firefox and text editors, so Steam Client is not the root cause for this behavior.

I strongly disagree. I'm using Solus 4.1. It works everywhere else but the Steam app.

Cynerd commented 4 years ago

I suspect this is a problem with (some?) X server\window managers, because I get similar "Shift key" and scrolling problems with other GUI apps like Firefox and text editors, so Steam Client is not the root cause for this behavior.

In this case it is Steam Client's fault or fault of some library it uses for sure. I even wrote my suspicion here four years ago. X server sends key press and release events. That is how application knows what you are typing. The problem is that if you use key shortcut to change focus such as win+cursor key then application receives win key press event and with press of cursor key the focus is changed so it receives FocusOut event. It won't receive win key release event. How X input should be handled in this case is that application should use key modifiers sent with key press/release event that contains info about shift key. Application should not track key press and release on its own because modifying key can be pressed when window is not focused and such event is not propagated to that specific application. It is invalid usage of X API.

This issue is present and reliably reproducible on Linux client from beginning. I was able to reproduce it with Gnome, KDE, awesome and i3. You just have to use shortcut that includes shift key to change focus and then return to Steam client with shift not pressed and that is it.

ashtonx commented 3 years ago

7 years later still an issue ;/ any workarounds ?

jimmy-print commented 3 years ago

7 years later still an issue ;/ any workarounds ?

I just shift-clicked again on one of the games and it fixed the problem.

prismz commented 3 years ago

Still a problem on Debian 11. My dwm keybind to move windows to another monitor includes the shift key, and as others have mentioned Steam doesn't seem to properly handle X events.

h1z1 commented 3 years ago

Not to bump an old thread but just realized no one reported what keyboards were in use nor if using ps/2 / console (not the sony kind) or USB. There are keyboards out there that do not work well or at all with multiple key combinations. Simple two key combinations work (ctrl-c/v for example), but anything more like requiring the hand of Spock, will not - especially the kind you're used to finding DO work on gaming keyboards. You can use something like the X event spy (xev) to see exactly what X is at least telling Steam. xwinfo -events will show what steam is listening for.

Fun fact - such keyboards are not usable in several Valve games I've tried. The hardware lacks it's own auto repeat (technically it's the dumb ps2->USB dongle) - so you're able to move for example but any modifier stops it. ie Strife jumping is impossible. Setting repeat in X is pointless as Valve does their own thing.

laNuez commented 2 years ago

Peek 2019-11-16 20-43

This was driving me nuts i thought my keyboard was malfunctioning. Please look into it

dsalt commented 2 years ago

It doesn't even have to be either of the Shift keys – I can reliably trigger this problem using Alt+key shortcuts to do things such as toggle the window size. However, the effect always appears as if it had been Shift which was pressed.

r3k2 commented 2 years ago

same issue here on USB keyboard, Arch linux and steam. it comes and goes for years and years, sometimes there is a steam desktop version that will give me the issue and sometimes it does not... is random.. today I started to have it yet again after months of not having it.

knikolaeff commented 2 years ago

Same here. Archcraft + bspwm + USB keyboard

AmberABit commented 2 years ago

This problem has been badly exasperated with the ability to shift-click to select multiple games. Half the time when I go into steam now to play a game, I spend double the time that I used just because I need to fix this before I can even hit the play button.

efield6568 commented 2 years ago

As a quick fix, I noticed that as the issue is caused by having pressed the Shift key and left focus, if you are out of focus and press shift, then focus steam and release the issue goes away.

rupansh commented 2 years ago

its been 8 years

krompus commented 1 year ago

Issue persists, and the Steam Overlay has a similar issue: I have it bound to Alt+Home (I have both of these keys on mouse buttons, I swear it's comfy lol), and when I open the Steam Overlay with Alt+Home and then close it with Escape, the game still acts like Alt is being held, so I am unable to jump (Space bar) until I press and release Alt again. Seen in Mordhau and Borderlands 3 for example. No problem when I close the overlay with a repeated Alt+Home. Should I create a new issue for that?

r3k2 commented 1 year ago

yeah this still happens on GNU/Linux

MacTavishAO commented 1 year ago

Any kid born on the day this issue was created goes to second grade today.

Splarkszter commented 1 year ago

No way this hasn't been fixed in 8 damm years. Ok then i'll stop spending my money here and start migrating to GoG faster than i thought.

ashtonx commented 1 year ago

No way this hasn't been fixed in 8 damm years. Ok then i'll stop spending my money here and start migrating to GoG faster than i thought.

As sad as it is, steam is still one digital store with best support on linux. I'm guessing you didn't play much with gog on linux.