[GH-ISSUE #204] Windows -> Wayland (Sway) Modifier Keys not registering #95

Closed
opened 2026-05-05 22:09:14 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @Vassili-Dev on GitHub (Sep 22, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/204

When running Windows + Sway:

Windows -> Sway: Modifier+Key only seems to register Key (Can't use Sway Shortcuts, Can't do ^C, etc)
Sway -> Windows: Works as expected

Windows

  • Windows Version: Windows 11 23H2
  • Emulation Backend: windows
  • Capture Backend: windows
  • Frontend: gtk (Also daemonized)

Sway

  • Sway Version: 1.9 (Arch 6.10.10-arch1-1, x86_64)
  • Emulation Backend: wlroots
  • Capture Backend: layer-shell
  • Frontend: gtk (Also daemonized)

Logs:
LanMouseLog_Sway.txt
LanMouseLog_Windows.txt

Originally created by @Vassili-Dev on GitHub (Sep 22, 2024). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/204 When running Windows + Sway: Windows -> Sway: `Modifier+Key` only seems to register `Key` (Can't use Sway Shortcuts, Can't do `^C`, etc) Sway -> Windows: Works as expected ### Windows - Windows Version: Windows 11 23H2 - Emulation Backend: windows - Capture Backend: windows - Frontend: gtk (Also daemonized) ### Sway - Sway Version: 1.9 (Arch 6.10.10-arch1-1, x86_64) - Emulation Backend: wlroots - Capture Backend: layer-shell - Frontend: gtk (Also daemonized) Logs: [LanMouseLog_Sway.txt](https://github.com/user-attachments/files/17091519/LanMouseLog_Sway.txt) [LanMouseLog_Windows.txt](https://github.com/user-attachments/files/17091520/LanMouseLog_Windows.txt)
Author
Owner

@Vassili-Dev commented on GitHub (Sep 22, 2024):

I won't pretend to know how this works, so please take this with a bucket of salt, but I suspect it has to do with to_key_event not generating KeyboardEvent::Modifiers.

b071201dcb/input-capture/src/windows.rs (L184-L225)

<!-- gh-comment-id:2367002615 --> @Vassili-Dev commented on GitHub (Sep 22, 2024): I won't pretend to know how this works, so please take this with a bucket of salt, but I suspect it has to do with `to_key_event` not generating `KeyboardEvent::Modifiers`. https://github.com/feschber/lan-mouse/blob/b071201dcb000a09330df81784d2ef2c0446da90/input-capture/src/windows.rs#L184-L225
Author
Owner

@feschber commented on GitHub (Sep 23, 2024):

Yeah, I hinted at this in the README: "Gnome -> Sway only partially works (modifier events are not handled correctly)"
This is a bit of a lie, as it does not only apply to GNOME but technically anything but Sway at this point, as you have realized.

You are totally right about the to_key_event function, however I think it's ultimately better to generate the Modifiers event on the client side rather than on every capture backend (this would need to be added to the input-capture-portal backend as well for example). The wlroots backend is the only backend that actually needs modifier events as far as I remember.

Unfortunately I have not found the time to implement this yet but its definitely a priority once the encryption stuff is done :)

<!-- gh-comment-id:2368823698 --> @feschber commented on GitHub (Sep 23, 2024): Yeah, I hinted at this in the README: "Gnome -> Sway only partially works (modifier events are not handled correctly)" This is a bit of a lie, as it does not only apply to GNOME but technically anything but Sway at this point, as you have realized. You are totally right about the `to_key_event` function, however I think it's ultimately better to generate the `Modifiers` event on the client side rather than on every capture backend (this would need to be added to the input-capture-portal backend as well for example). The wlroots backend is the only backend that actually needs modifier events as far as I remember. Unfortunately I have not found the time to implement this yet but its definitely a priority once the encryption stuff is done :)
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#95
No description provided.