[GH-ISSUE #357] [Linux client + MacOS server] Sticky modifier keys #186

Closed
opened 2026-05-05 22:13:08 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @kiwiz on GitHub (Dec 12, 2025).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/357

Client (IO source): KDE/Wayland, Ubuntu, commit: 3922b45bd9
Server: MacOS, commit: 640fa995a4

When performing key combinations (ex: meta+tab), the modifier key appears to get stuck down. Hitting the key again resets the state. FWIW, MacOS -> MacOS works perfectly fine.

Originally created by @kiwiz on GitHub (Dec 12, 2025). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/357 Client (IO source): KDE/Wayland, Ubuntu, commit: 3922b45bd92f07f62e8af84bb9471abf8b0873a3 Server: MacOS, commit: 640fa995a4ae3c5a0aaaafe04857930979edc220 When performing key combinations (ex: meta+tab), the modifier key appears to get stuck down. Hitting the key again resets the state. FWIW, MacOS -> MacOS works perfectly fine.
Author
Owner

@kiwiz commented on GitHub (Jan 12, 2026):

Mac -> Mac

+ [2026-01-12T23:35:37Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 125, state: 1 })
+ [2026-01-12T23:35:37Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(0x0) } 125
+ [2026-01-12T23:35:37Z WARN  input_emulation::macos] key event: 55 1
- [2026-01-12T23:35:37Z WARN  input_emulation::macos] modifiers updated: XMods(Mod4Mask)
...

+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 15, state: 1 })
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 55
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] key event: 55 0
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] key event: 48 1

+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 15, state: 0 })
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 48
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] key event: 48 0

+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 125, state: 0 })
+ [2026-01-12T23:35:39Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 125
- [2026-01-12T23:35:39Z WARN  input_emulation::macos] modifiers updated: XMods(0x0)

Linux -> Mac

+ [2026-01-12T23:39:41Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186694665, key: 125, state: 1 })
+ [2026-01-12T23:39:41Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(0x0) } 125
+ [2026-01-12T23:39:41Z WARN  input_emulation::macos] key event: 55 1
...

+ [2026-01-12T23:39:43Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186696549, key: 15, state: 1 })
+ [2026-01-12T23:39:43Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15
+ [2026-01-12T23:39:43Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 55
+ [2026-01-12T23:39:43Z WARN  input_emulation::macos] key event: 55 0
+ [2026-01-12T23:39:43Z WARN  input_emulation::macos] key event: 48 1

+ [2026-01-12T23:39:44Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186697887, key: 15, state: 0 })
+ [2026-01-12T23:39:44Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15
+ [2026-01-12T23:39:44Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 48
+ [2026-01-12T23:39:44Z WARN  input_emulation::macos] key event: 48 0

+ [2026-01-12T23:39:45Z WARN  input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186698053, key: 125, state: 0 })
+ [2026-01-12T23:39:45Z WARN  input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 125

It looks like modifier_event isn't being called in certain cases.

<!-- gh-comment-id:3741040172 --> @kiwiz commented on GitHub (Jan 12, 2026): Mac -> Mac ```diff + [2026-01-12T23:35:37Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 125, state: 1 }) + [2026-01-12T23:35:37Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(0x0) } 125 + [2026-01-12T23:35:37Z WARN input_emulation::macos] key event: 55 1 - [2026-01-12T23:35:37Z WARN input_emulation::macos] modifiers updated: XMods(Mod4Mask) ... + [2026-01-12T23:35:39Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 15, state: 1 }) + [2026-01-12T23:35:39Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15 + [2026-01-12T23:35:39Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 55 + [2026-01-12T23:35:39Z WARN input_emulation::macos] key event: 55 0 + [2026-01-12T23:35:39Z WARN input_emulation::macos] key event: 48 1 + [2026-01-12T23:35:39Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 15, state: 0 }) + [2026-01-12T23:35:39Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15 + [2026-01-12T23:35:39Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 48 + [2026-01-12T23:35:39Z WARN input_emulation::macos] key event: 48 0 + [2026-01-12T23:35:39Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 0, key: 125, state: 0 }) + [2026-01-12T23:35:39Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 125 - [2026-01-12T23:35:39Z WARN input_emulation::macos] modifiers updated: XMods(0x0) ``` Linux -> Mac ```diff + [2026-01-12T23:39:41Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186694665, key: 125, state: 1 }) + [2026-01-12T23:39:41Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(0x0) } 125 + [2026-01-12T23:39:41Z WARN input_emulation::macos] key event: 55 1 ... + [2026-01-12T23:39:43Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186696549, key: 15, state: 1 }) + [2026-01-12T23:39:43Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15 + [2026-01-12T23:39:43Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 55 + [2026-01-12T23:39:43Z WARN input_emulation::macos] key event: 55 0 + [2026-01-12T23:39:43Z WARN input_emulation::macos] key event: 48 1 + [2026-01-12T23:39:44Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186697887, key: 15, state: 0 }) + [2026-01-12T23:39:44Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 15 + [2026-01-12T23:39:44Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 48 + [2026-01-12T23:39:44Z WARN input_emulation::macos] key event: 48 0 + [2026-01-12T23:39:45Z WARN input_emulation::macos] Event::Keyboard Keyboard(Key { time: 1186698053, key: 125, state: 0 }) + [2026-01-12T23:39:45Z WARN input_emulation::macos] update_modifiers Cell { value: XMods(Mod4Mask) } 125 ``` It looks like `modifier_event` isn't being called in certain cases.
Author
Owner

@feschber commented on GitHub (Feb 6, 2026):

which input-capture backend is used on linux?

<!-- gh-comment-id:3863004724 --> @feschber commented on GitHub (Feb 6, 2026): which input-capture backend is used on linux?
Author
Owner

@kiwiz commented on GitHub (Feb 7, 2026):

Wayland (KDE)

<!-- gh-comment-id:3863122546 --> @kiwiz commented on GitHub (Feb 7, 2026): Wayland (KDE)
Author
Owner

@kiwiz commented on GitHub (Feb 7, 2026):

Ah sorry, it's libei

<!-- gh-comment-id:3863141051 --> @kiwiz commented on GitHub (Feb 7, 2026): Ah sorry, it's libei
Author
Owner

@kenichi commented on GitHub (Feb 11, 2026):

Thanks for a great tool! I've been having this exact problem, except Gnome/Wayland, still libei. So far, this branch is working for me:

https://github.com/kenichi/lan-mouse/tree/linux_to_macos_fix

can test with cargo install --git https://github.com/kenichi/lan-mouse.git --branch linux_to_macos_fix

<!-- gh-comment-id:3881601653 --> @kenichi commented on GitHub (Feb 11, 2026): Thanks for a great tool! I've been having this exact problem, except Gnome/Wayland, still libei. So far, this branch is working for me: https://github.com/kenichi/lan-mouse/tree/linux_to_macos_fix can test with `cargo install --git https://github.com/kenichi/lan-mouse.git --branch linux_to_macos_fix`
Author
Owner

@feschber commented on GitHub (Feb 11, 2026):

@kenichi are you open to making a PR?

<!-- gh-comment-id:3884015998 --> @feschber commented on GitHub (Feb 11, 2026): @kenichi are you open to making a PR?
Author
Owner

@kenichi commented on GitHub (Feb 11, 2026):

@feschber yes, no problem. though I'm not sure about affects to other OS combos 🤷🏽‍♂️

<!-- gh-comment-id:3886151595 --> @kenichi commented on GitHub (Feb 11, 2026): @feschber yes, no problem. though I'm not sure about affects to other OS combos 🤷🏽‍♂️
Author
Owner

@feschber commented on GitHub (Feb 13, 2026):

@feschber yes, no problem. though I'm not sure about affects to other OS combos 🤷🏽‍♂️

We might get duplicated modifier events but I don't think that should cause any problems.
Eventually I think its best to handle modifier events entirely client side but as a temporary fix this is certainly okay!

<!-- gh-comment-id:3896782442 --> @feschber commented on GitHub (Feb 13, 2026): > [@feschber](https://github.com/feschber) yes, no problem. though I'm not sure about affects to other OS combos 🤷🏽‍♂️ We might get duplicated modifier events but I don't think that should cause any problems. Eventually I think its best to handle modifier events entirely client side but as a temporary fix this is certainly okay!
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/lan-mouse#186
No description provided.