[GH-ISSUE #1175] Held keys randomly "bounce" #943

Open
opened 2026-05-05 07:18:59 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @Techjar on GitHub (May 30, 2021).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1175

Describe the bug
When holding a key down for an extended period of time, it will sometimes quickly release and press again, despite still holding down the physical key. This only happens on the client machine(s) through Barrier, not on the server machine, so it isn't a hardware issue or anything. My client machine is Windows in this case, and server machine is Linux. I don't know if it happens with other operating system combinations and I don't have the means to test that.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://keyboard-test.space/ on a Barrier client machine (may need to be Windows, unsure)
  2. Hold down any key on the keyboard
  3. Observe that the key report at the top will randomly have an entry added despite not releasing the key

Expected behavior
The key should remain held and never release until I actually release the physical key.

Desktop (please complete the following information):

  • OS: Linux server, Windows client
  • Barrier version: 2.3.2

Additional context

This causes annoyance in games that require you to hold down a key for several seconds to complete an action, as the action will randomly restart due to this issue.

Originally created by @Techjar on GitHub (May 30, 2021). Original GitHub issue: https://github.com/debauchee/barrier/issues/1175 **Describe the bug** When holding a key down for an extended period of time, it will sometimes quickly release and press again, despite still holding down the physical key. This only happens on the client machine(s) through Barrier, not on the server machine, so it isn't a hardware issue or anything. My client machine is Windows in this case, and server machine is Linux. I don't know if it happens with other operating system combinations and I don't have the means to test that. **To Reproduce** Steps to reproduce the behavior: 1. Go to https://keyboard-test.space/ on a Barrier client machine (may need to be Windows, unsure) 2. Hold down any key on the keyboard 3. Observe that the key report at the top will randomly have an entry added despite not releasing the key **Expected behavior** The key should remain held and never release until I actually release the physical key. **Desktop (please complete the following information):** - OS: Linux server, Windows client - Barrier version: 2.3.2 **Additional context** This causes annoyance in games that require you to hold down a key for several seconds to complete an action, as the action will randomly restart due to this issue.
Author
Owner

@Techjar commented on GitHub (May 31, 2021):

I have narrowed the issue down to key repeat. If I disable key repeat on the Linux (server) machine, the issue goes away.

<!-- gh-comment-id:851426349 --> @Techjar commented on GitHub (May 31, 2021): I have narrowed the issue down to key repeat. If I disable key repeat on the Linux (server) machine, the issue goes away.
Author
Owner

@apanteleev commented on GitHub (Jun 29, 2021):

I'm observing the same issue with a Windows server and Linux clients. When holding a key long enough, the client gets "key released" events followed by "key pressed", which can break things like camera controls in 3D apps.

Easily reproducible with the glfw "events" test running on the client, see https://github.com/glfw/glfw/tree/master/tests

<!-- gh-comment-id:870864452 --> @apanteleev commented on GitHub (Jun 29, 2021): I'm observing the same issue with a Windows server and Linux clients. When holding a key long enough, the client gets "key released" events followed by "key pressed", which can break things like camera controls in 3D apps. Easily reproducible with the glfw "events" test running on the client, see https://github.com/glfw/glfw/tree/master/tests
Author
Owner

@CloudMax94 commented on GitHub (Apr 23, 2022):

I've come across this problem as well when playing certain games for months now with movement sometimes stuttering in weird ways. Wasn't until just today that I realized what was actually happening. Became pretty obvious that holding a key was not working properly in some situations when I was playing a game which required me to hold down a button without interruption for several seconds.

More interestingly, I noticed that this problem never happens if I constantly move my mouse (when set at a decent polling rate) while holding down a key. So an annoying workaround for me right now is to simply move the mouse constantly whenever I need to hold down a key without interruption, which is less than ideal, but at least its something.
This led me to believe that the issue might be polling related and that repeat state is lost for whatever reason when events aren't received often enough? Or at least something in that vein. I tried looking over the code but it goes way beyond me.

Disabling Repeat Keys on the host as mentioned above also works, but that will then ofc. also disable repeat keys which is something I absolutely do not want to do as it makes typing, among other things, very awkward.

I'm on Barrier 2.4.0, Linux host & Windows client.

<!-- gh-comment-id:1107458167 --> @CloudMax94 commented on GitHub (Apr 23, 2022): I've come across this problem as well when playing certain games for months now with movement sometimes stuttering in weird ways. Wasn't until just today that I realized what was actually happening. Became pretty obvious that holding a key was not working properly in some situations when I was playing a game which required me to hold down a button without interruption for several seconds. More interestingly, I noticed that this problem **_never_** happens if I constantly move my mouse (when set at a decent polling rate) while holding down a key. So an annoying workaround for me right now is to simply move the mouse _constantly_ whenever I need to hold down a key without interruption, which is less than ideal, but at least its something. This led me to believe that the issue might be polling related and that repeat state is lost for whatever reason when events aren't received often enough? Or at least something in that vein. I tried looking over the code but it goes way beyond me. Disabling Repeat Keys on the host as mentioned above also works, but that will then ofc. also disable repeat keys which is something I absolutely do not want to do as it makes typing, among other things, very awkward. I'm on Barrier 2.4.0, Linux host & Windows client.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#943
No description provided.