Cursr icon indicating copy to clipboard operation
Cursr copied to clipboard

Modifier keys get stuck on one key

Open anthonypants opened this issue 7 months ago • 3 comments

If I'm normally typing on the host (where the keyboard and mouse are plugged in) and swap to a client (where the mouse and keyboard are not), I'll notice that sometimes certain keys stop working. Sometimes pressing those keys will trigger shortcuts, as if I'd had a modifier key pressed down (e.g. the macOS "Fn" key). However, other keys do not behave this way, and the host computer does not exhibit this issue. Changing the Keyboard Layout setting from Source to Current or vice versa does not seem to affect this issue.

I don't have a method of reliably reproducing this, unfortunately, but it'll happen multiple times a day. It even happened while I was in the middle of writing this up. It seems to happen most often with the "e" key, but I've also had it happen to the "m" key. I have a physical kvm, and swapping keyboards back and forth seems to be a fix for this, but I'd prefer not to have to do that.

From the Cursr logs, here's some examples of the "e" key misbehaving. All of these logs were captured from the remote computer. The host computer is Windows 11 22631.3810, and the remote computer is macOS Sonoma 14.5. Both computers are running Cursr 1.7.2.

Here's an example of when the "e" key is not read:

2024-07-03T01:40:33.666Z [info] [Net] Receive 'key.down' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e","locks":{"caps":false,"num":false}}
2024-07-03T01:40:33.666Z [info] native sim char down sc18 u101
2024-07-03T01:40:33Z [[0;36mn_info[0m] Key 14 pressed. (sc=18 uc=-1)
2024-07-03T01:40:33.668Z [info] Processing key change to down (sc:18/kc:14/c:undefined-npr/calt:undefined) 14 ( undefined/undefined ) mask: 0 ()
2024-07-03T01:40:33.668Z [info] Current shortcut pattern: 
2024-07-03T01:40:33.785Z [info] [Net] Receive 'key.up' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e"}
2024-07-03T01:40:33.786Z [info] native sim char up sc18 u101
2024-07-03T01:40:33.787Z [info] Processing key change to up (sc:18/kc:14/c:undefined-npr/calt:undefined) 14 ( undefined/undefined ) mask: 0 ()
2024-07-03T01:40:33.787Z [info] Current shortcut pattern: 

When the e key opens up the emoji window (shortcut is Fn+E, so presumably it thinks the "Fn" key is being held down? but my keyboard does not have an "Fn" key):

2024-07-03T04:37:08.815Z [info] [Net] Receive 'key.down' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e","locks":{"caps":false,"num":true}}
2024-07-03T04:37:08.815Z [info] native sim key down by scan code 18
2024-07-03T04:37:08Z [[0;36mn_info[0m] Key 14 pressed. (sc=18 uc=-1)
2024-07-03T04:37:08.818Z [info] Processing key change to down (sc:18/kc:14/c:undefined-npr/calt:undefined) 14 ( undefined/undefined ) mask: 0 ()
2024-07-03T04:37:08.818Z [info] Current shortcut pattern: 
2024-07-03T04:37:08.933Z [info] [Net] Receive 'key.up' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e"}
2024-07-03T04:37:08.933Z [info] native sim key up by scan code 18
2024-07-03T04:37:08.938Z [info] Processing key change to up (sc:18/kc:14/c:undefined-npr/calt:undefined) 14 ( undefined/undefined ) mask: 0 ()
2024-07-03T04:37:08.938Z [info] Current shortcut pattern: 

Swapping keyboards to the native host:

2024-07-03T04:38:17Z [[0;36mn_info[0m] Key 14 pressed. (sc=18 uc=101)
2024-07-03T04:38:17.776Z [info] Processing key change to down (sc:18/kc:14/c:101-pr/calt:undefined) E ( E/e ) mask: 0 ()
2024-07-03T04:38:17.776Z [info] Current shortcut pattern: E
2024-07-03T04:38:17.878Z [info] Processing key change to up (sc:18/kc:14/c:101-pr/calt:undefined) E ( E/e ) mask: 0 ()
2024-07-03T04:38:17.878Z [info] Current shortcut pattern: 

Swapping keyboards back to the remote computer, and now the "e" key works again:

2024-07-03T04:39:04.525Z [info] [Net] Receive 'key.down' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e","locks":{"caps":false,"num":true}}
2024-07-03T04:39:04.525Z [info] native sim key down by scan code 18
2024-07-03T04:39:04Z [[0;36mn_info[0m] Key 14 pressed. (sc=18 uc=69)
2024-07-03T04:39:04.527Z [info] Processing key change to down (sc:18/kc:14/c:69-pr/calt:undefined) E ( E/E ) mask: 0 ()
2024-07-03T04:39:04.527Z [info] Current shortcut pattern: E
2024-07-03T04:39:04.599Z [info] [Net] Receive 'key.up' from eba366f1-e314-400b-a087-942f631aea37 {"scanCode":18,"char":{"code":101,"printable":true},"keyName":"e"}
2024-07-03T04:39:04.600Z [info] native sim key up by scan code 18
2024-07-03T04:39:04.602Z [info] Processing key change to up (sc:18/kc:14/c:69-pr/calt:undefined) E ( E/E ) mask: 0 ()
2024-07-03T04:39:04.602Z [info] Current shortcut pattern: 

anthonypants avatar Jul 03 '24 04:07 anthonypants