mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #207] super key (windows key) gets stuck in "pressed" on client #169
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @exodist on GitHub (Dec 23, 2018).
Original GitHub issue: https://github.com/debauchee/barrier/issues/207
Operating Systems
Arch Linux
Barrier Version
2.1.0
Steps to reproduce bug
Other info
This is 2 fresh barrier installs on 2 fresh arch linux installs. Both are using awesome windows manager which uses the super key heavily. It works for a few seconds, but then gets stuck in down position, even if you do not do anything. rebooting is the only way to make it stop, even killing the barrier client does not make the keypress stop. Keypress never starts or gets stuck if barrier is never loaded.
@joshskidmore commented on GitHub (Mar 18, 2019):
I also have this issue with linux server -> linux client (both Arch). It's oftentimes a stuck super/meta key, but occasionally other modifiers (shift or ctrl). If I experience the problem (let's say its shift for this example), if I restart the barrier server, switch back to the client machine, things are normal. If I immediately switch back to the host, then back to the client, the shift key is stuck again. The modifier stays "stuck" on the client machine's physical keyboard as well. The typical way to resolve this is for me to just reboot the client machine.
Any advice on how I could help debug this would be appreciated as it's driving me absolutely insane. I am able to SSH into the client machine. I've tried
DISPLAY=:0 xset -qandDISPLAY=:0 xevto debug and everything seems normal (no held modifiers being shown with xset and the "correct" keys are being pressed (through barrierc or directly) on the client.This problem exists using Barrier 2.2.0 as well as Synergy 1.10.1.
@DarwinSurvivor commented on GitHub (May 1, 2019):
I'm getting this on practically a daily basis as well. I'm running Arch Linux (recently updated) on both client and server. The problem primarily appears to affect the client, and like Josh, continues even after killing barrier on the client machine.
To fix the problem, I have to log out (to my TTY), log back in and restart X.
@noisyshape commented on GitHub (May 1, 2019):
I think this is a problem for Windows clients as well and that several different modifier keys can become stuck. If anyone can reproduce it reliably, that would be helpful.
@DarwinSurvivor commented on GitHub (May 1, 2019):
For me, it tends to be the Alt key. I have my environment configured so that Alt is used to move and resize windows (Alt+drag). It's possible it's getting triggered when I alt-drag a window to the edge of the screen (the edge that would normally allow my mouse to move back to the host computer). I'll keep an eye out when I'm moving windows around and see if that has something to do with it (modifier being held when the mouse moves between devices).
@xgdgsc commented on GitHub (Jul 21, 2019):
I have a meta key stuck using ubuntu server and windows client. At first meta key only works for ubuntu and then doesn' t work for either.
@DarwinSurvivor commented on GitHub (Oct 16, 2019):
Is there any debugging we can do or logs we can provide that might help get this problem fixed? At this point, I'm contemplating switching to something else because having to close my entire X-window session just to get my keyboard working on a daily basis is not sustainable and the problem seems to be getting worse.
If there is something I can provide, this problem now reliably happens once a day, so I could provide data very quickly and repeatedly.
@joshskidmore commented on GitHub (Oct 16, 2019):
@DarwinSurvivor - The only thing that I've found to "reset" this (without leaving X) is the following ... and it's not ideal (at all):
@DarwinSurvivor commented on GitHub (Oct 28, 2019):
I've now had this affect non-modifiers somehow.
For example, I use cVim, so "x" is equivalent to "Ctrl+F4" and closes the current tab. I've had the x key get stuck, which means when I switch to a chrome window, it rapid-filer closes all my tabs until the entire window disappears.
@gwyker commented on GitHub (Nov 7, 2019):
My super-key gets stuck like this sometimes. Other keys like x can also get stuck, as DarwinSurvivor mentioned, though those keys always right themselves after a second or two on my machine. I assumed that was caused by (wi-fi) lag since my cursor freezes as well while the client mashes out 'xxxxxxxxx' then stops. The super-key issue seems to be nearly permanent though, outside of restarting X / rebooting.
Server: Windows 10
Client: Linux Mint 19.1 Cinnamon
@itutto commented on GitHub (Nov 14, 2019):
I get the same with the ALT key.
The behavior becomes inverse. When I press the Alt key on the host then the client behaves like it is not pressed. It happened twice already. I'm not sure what fixed it the first time.
Server: Windows 10
Client: macOS High Sierra 10.13.6
*update:
When the ALT key gets stuck, I can press the CONTROL key to resolve it.
@miraculixx commented on GitHub (Nov 21, 2019):
I experience the same (Super key stuck, sometimes the Ctrl key) with a MacOS host and Linux Mint client.
This happens intermittently without known cause, though I observe that it often happens when using Skype or Google Hangout with a head set. To resolve sometimes restarting X helps, sometimes a full shutdown/reboot is needed. setxkbmap / xdotool does not seem to reset.
Server: macOS High Sierra 10.13.6
Client: Linux Mint 18.3
Network: LAN connection to the same switch, same subnet (no Wifi)
Barrier 2.3.2-Release-210c2b70
What in Barrier would cause meta keys to be "pressed" in the client? There must be some event that causes a change of state and then keeps it from getting reset, I presume perhaps naively.
@axtux commented on GitHub (May 19, 2020):
Same problem with Shift key not released from client. I would rename the title as it seems to affect more modifiers than just super key.
Operating Systems
Server: Ubuntu 18.04 (Kernel 4.15.0-99-generic)
Client: Ubuntu 18.04 (Kernel 5.3.0-51-generic)
Barrier Version
Server: barrierc 2.3.2-13-g9080ce45
Client: barriers 2.3.2-13-g9080ce45
@axtux commented on GitHub (May 19, 2020):
Found similar issue in Synergy https://github.com/symless/synergy-core/issues/6459
@axtux commented on GitHub (May 22, 2020):
Small update to make it clear, the unreleased key happens every time I press the shift key so it is unlikely caused by a network issue.
@Cloudbyte-Pony commented on GitHub (Jun 10, 2020):
Server: barrier 2.3.2-snapshot-210c2b70 (Windows 10 1909)
Client: barrier 2.3.2-RELEASE-00000000 (Arch Linux up to date, Mate 1.24 over Xorg)
Same, CTRL client stuck on client, pressing CTRL-ALT-DEL while on client invokes Server (Windows)(Lock|SwitchUser|Sign Out|Task Manager) menu, then ESC to go back to desktop un-stucks CTRL on client for a few seconds (20 seconds at most), then it gets stuck again on it's own.
Logs at Debug2 level on both client and server show nothing useful, just the "entering/leaving screen" messages.
Bug makes client pretty unusable, as it interprets simple keystrokes as commands due to ctrl involvement.
@mikmorg commented on GitHub (Jun 10, 2020):
I'm experiencing this as well, with both ctrl and alt keys on client getting stuck.
Client and Server are both Ubuntu, both version 2.3.2-snapshot-9080ce45.
@richwalker commented on GitHub (Jul 2, 2020):
Debian 2.1.2+dfsg-1
Shift key pressed on client stops other keys working unless I still have the shift key pressed. e.g. after typing L then I can only type other capital letters.
Moving pointer back to server then back to client resets it.
@AdrianDC commented on GitHub (Jul 24, 2020):
Happens regularly between my two Linux Mint (20 and 19) computers with Barrier 2.3.3.
Turns out the right shift key gets stuck, labelled SHIFT_R.
A simple press / release of the key resolves the issue.
Stuck keys can be detected this way :
xev | grep 'keycode .* (.*)'@miraculixx commented on GitHub (Jul 28, 2020):
In addition to my earlier comment, this happens frequently in connection with either of the following activities, on the Linux client:
Once the key got stock (for me it is the Ctrl key), other symptoms start to appear seconds to minutes later like not being able to type random characters in a new terminal window, no caps or no keyboard input at all. Typically the situation gets worse and the only solution is to reboot.
Note it also happens sometimes without any of these activities, but more rarely so.
Client:
Linux 4.15.0-107-generic #108~16.04.1-Ubuntu SMP Fri Jun 12 02:57:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Barrier 2.3.2-snapshot-210cb270
Build Date: Friday June 5 2020
Server:
Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed May 27 17:00:02 PDT 2020; root:xnu 4570.71.80.1~1/RELEASE_X86_64 x86_64
Barrier: 2.3.2-Release-210cb270
Build Date: 3 October 2019
Network: Ethernet, 1GB, same subnet, sometimes wifi (barrier und client are on the same router, however server is connected via ethernet, client via wifi)
Workaround
I may have found a work around in relation to suspend mode (which disrupts the network connection), still testing as of writing this. The investigation shows that the stuck key starts to happen right after the network disruption has been fixed and barrier reconnects automatically. When barrier is stopped before the network disruption (e.g. on suspend) and is restarted only after the network is ok again, there does not seem to be a stuck key. Perhaps this hints to an issue in barriers network / reconnection handling?
For the work around on suspend, see https://gist.github.com/miraculixx/4cfb26cad33943f90742ad98b4ce9f87
Updated
26 Aug 2020 - added wifi connection as a contributor to frequency
28 Aug 2020 - added wifi to ethernet switch as a contributor to frequency
15 Feb 2022 - may have found a work around
@artnaseef commented on GitHub (Aug 12, 2020):
Running into this problem today, I think I can reproduce it fairly regularly. Trying to narrow down exact steps.
What I have so far is this:
I found that, at least at one point, I had multiple barrier processes running (not barrierc, but barrier), on the Linux client. I'm going to restart everything fresh and see if I can narrow down a set of steps that reproduces the problem cleanly.
@artnaseef commented on GitHub (Aug 12, 2020):
OK, I did some more testing that reliably reproduces the problem:
If you read through this carefully, you will find I was able to recover one time, but a second time, it did not recover.
The odd thing is that it's the ALT key that seems to trigger it, even though, in this attempt, the CTRL and SHIFT keys were the ones that got stuck. I also found that using
xdotoolto reset modifiers works, but I had trouble getting ALT to clear until I used the following command-line, copied from @joshskidmore above, which appears to do the job (note I have to login via SSH to run this since the stuck modifiers make it impossible to run commands directly on the ubuntu machine):Thank you @joshskidmore!
Also note that this time, there was never a duplicate barrier process detected on the Linux client.
@artnaseef commented on GitHub (Aug 12, 2020):
Another data-point: using SSH to login to the linux machine and start barrier, the problem does not happen.
Hmm, and another data-point: using SSH to login to the linux machine and start barrier, WHILE holding down CTRL-ALT-SHIFT on the secondary usb keyboard (directly connected to the linux machine), DOES reproduce the problem.
@miraculixx commented on GitHub (Oct 31, 2020):
I can now reliably reproduce the problem:
Only rebooting solves the problem.
Note: this does not happen when barrier is not running. I conclude that it is not a Linux/hardware issue.
Client:
Linux 4.15.0-107-generic #108~16.04.1-Ubuntu SMP Fri Jun 12 02:57:13 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Barrier 2.3.2-snapshot-210cb270
Build Date: Friday June 5 2020
Server:
Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed May 27 17:00:02 PDT 2020; root:xnu 4570.71.80.1~1/RELEASE_X86_64 x86_64
Barrier: 2.3.2-Release-210cb270
Build Date: 3 October 2019
Updated:
With Client 2.3.3-release-3395-cca9 (Build Date November 10, 2020) this is 100% reproducible by disconnecting the still running client from the server for a couple of hours, then reconnecting. Every single time the client's ctrl key is "stuck" afterwards and the only remedy is to reboot.
Workaround
I may have found a workaround in relation to suspend mode (which disrupts the network connection). The investigation shows that the stuck key starts to happen right after the network disruption has been fixed and barrier reconnects automatically. When barrier is stopped before the network disruption (e.g. on suspend) and is restarted only after the network is ok again, there does not seem to be a stuck key. Perhaps this hints to an issue in barriers network / reconnection handling?
For the workaround on suspend, see https://gist.github.com/miraculixx/4cfb26cad33943f90742ad98b4ce9f87
Updated 09.2024:
Ever since I have employed this workaround (to kill barrier whenever the network is disconnected, such as on entering sleep), the frequency of the stuck keys issue has gone away almost completely. The only time I can see it happening now is when there is a network issue of some kind or when the system is overloaded.
@elicoten commented on GitHub (Oct 31, 2020):
When it happened to me, I wasn't plugging or unplugging anything. Both laptops stayed on WiFi throughout (unless there were some silent disconnections and reconnections that I'm not aware of - but I have no reason to suspect any silent disconnections.
@cvalentin-adeo commented on GitHub (Nov 2, 2020):
I have the same problem as you that makes barrier unusable ... :'(
@501st-alpha1 commented on GitHub (Nov 2, 2021):
I ran into this problem too; it definitely happened with Alt, Shift, and Control, probably Super, and I'm pretty sure even Enter at least once. My Barrier server is running on Debian, Barrier version 2.2.0, and the client in question is Pop! OS, with Barrier version 2.3.3. Interestingly, I also have another Debian client (different version of Debian from the server, not sure which version of Barrier), but I haven't had the problem there. I also haven't noticed the problem on my Windows client (Barrier version 2.3.3-release-3395cca9). All four devices are connected via. Ethernet to the same router, and I wasn't doing anything with external keyboards, so I don't think either of those factors apply to me.
I was sometimes able to fix the issue by pressing the stuck keys again, but I've had varying success with that, and also it can be hard to tell which key is stuck. The script provided by @joshskidmore fixes the issue (thanks!) and unsticks any keys, at least until the next time it happens. I usually keep SSH (+ Mosh) sessions open between my devices anyway, so I'll be keeping that script handy. (And it does have to be SSH, because sometimes the stuck keys will mean I'm unable to trigger the script directly on the client.)
@geolaw commented on GitHub (Jan 26, 2022):
I'm also seeing this issue which seriously has had me scratching my head and wondering WTF is going on.
I am currently running barrier on fedora and RHEL8 :
$ rpm -qa |grep barrier ; ssh rhlaptop rpm -qa |grep barrier
barrier-2.3.3-4.fc35.x86_64
barrier-2.3.3-2.epel8.playground.x86_64
Ubuntu and Regolith were also previously in the mix as well as Synergy 1.14 -
synergy_1.14.0-stable.67d824b8.el8.rpm
On RHEL8 synergy was not working properly which made me switch to barrier.
I previously had been a paid synergy supporter going back probably close to 10 years. Finding
this bug report makes me wonder really how long this has been going on because I swear I've
had this issue forever.
Anyway, My problem normally manifests itself when I am clicking in a web browser on a client.
Clicking a login button that usually just opens within the same tab will often open a new tab
sometimes I can tap on the various keys, ctrl, alt, meta, etc and it will "unstick" but other times
I can usually mouse back to the server machine and then back and its fine.
I'm not using the GUI "barrer" - calling barrierc / barriers directly from my i3 start up scripts.
I can enable debug logging and things if needed.
@mirh commented on GitHub (Feb 28, 2022):
https://github.com/symless/synergy-core/issues/4493
I, for one, am getting scroll lock stuck which makes for all the kind of consequent issues https://github.com/debauchee/barrier/issues/102 https://github.com/debauchee/barrier/issues/1291
@Sakata-MC commented on GitHub (Apr 18, 2023):
I get this when using my Windows host and Linux client as well. I use a G-key macro to switch computers, "Alt+Control+Shift+{" and "Alt+Control+Shift+}" for switch to main and switch to client, respectively. I use the RIGHT modifier keys for my macros.
Never gets stuck coming back to windows, but often gets stuck on client.
For myself, if I press and release the RIGHT control/alt/shift keys (whichever I see is stuck) then I can continue along fine, it's just more of an annoyance for me.
@TIAcode commented on GitHub (Jan 8, 2024):
Same problem, two Arch Linuxes with headless barrier. Always the windows key. xdotool works, thanks for that!
Running xmodmap over ssh when the keys were stuck I got these messages, last two times it has been the same combination of keys. I'm wondering if I could detect the one of the keys being stuck for a while and run that xdotool command automatically.
@bkowenswork commented on GitHub (Jun 11, 2024):
I've tested this on my Ubuntu 22.04 and have spotted this behavior on XFCE, KDE and Gnome. There isn't an obvious trigger, it can take days or weeks to happen or it can happen twice in the same day.
@ohel commented on GitHub (Sep 24, 2024):
I've had the same problem for a couple of years. It used to resolve itself by just pressing the stuck key and releasing it physically, and the problem didn't occur frequently at all. The stuck key might've been Super, but also Ctrl, Alt or Shift.
But now recently I've had the Super key stuck on client almost all the time. Using "xdotool key --clearmodifiers Escape" along with restarting the barrier client helps to get the Super key unstuck via SSH, but it gets stuck again if I press it. My client is Gentoo, server has been Ubuntu 22.04 and now 24.04.
Edit: I just noticed when the Super key gets stuck and if I do the xdotool trick, keyboard works. But, immediately if my mouse pointer visits the server's display and goes back to the client, the Super key is stuck again on client. Stopping and starting the barrier server also resets the key, but again, it's enough for my mouse pointer to visit the server's screen and Super is stuck on client - even if I restart both the barrier server and client.
@miraculixx commented on GitHub (Sep 25, 2024):
Wifi can show intermittent connection issues such as varying speeds and can be causing timeouts for barrier that are not perceptible to a user. I have found that stuck key issues frequently happen when barrier is connected via WLAN, however do not occur with wired connections on my local network.
@cephcyn commented on GitHub (Nov 5, 2025):
Adding a comment to note that this is also a frequent issue for me.
I am usually using Windows 10 host, Ubuntu 24.04 client, connected via WLAN, and have experienced Super, Shift, and Ctrl keys stuck at varying times. Sometimes this is shortly after resuming from suspend, sometimes this is mid-session (maybe the router had a hiccup).
@nbolton commented on GitHub (Nov 5, 2025):
Barrier is no longer in development. Check out Deskflow (upstream) or Input Leap (fork).
https://github.com/deskflow/deskflow
https://github.com/input-leap/input-leap
If this is still an issue in those projects, we would appreciate a cross-post of this issue.