Skip to content

Keyboard capture for Windows, too #288

Description

@bk138

To intercept hotkeys and the like to go to the remote instead of to the host OS.

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowshookexw
https://learn.microsoft.com/en-us/windows/win32/winmsg/lowlevelkeyboardproc
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-kbdllhookstruct
https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

https://learn.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-postmessagew
https://devblogs.microsoft.com/oldnewthing/20050530-11/?p=35513
https://devblogs.microsoft.com/oldnewthing/20250319-00/?p=110979

  • setup test case
  • test translateKeyode - has issues with char vs keydown
  • test direct HWND posting - F11 still gets to viewer window somehow, super-left/right still seen by windows host
  • test vkToWx - has challenges with shift and control, also when to keydown vs char, but all keys are received, just needs extensive remodeling
  • test sendInput - works better than PostMessage w/ Ctrl et al, but Super key gets routed to host Windows, for instance
  • check gdk impl - no keyboard grab for win ⛔
  • check qt impl - no keyboard grab for win ⛔

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions