LGUG2Z / whkd

A simple hotkey daemon for Windows
MIT License
529 stars 12 forks source link

[BUG]: Virtual Keycodes not working #37

Open F1orian opened 7 months ago

F1orian commented 7 months ago

Describe the bug Most of the virtual Keycodes from https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes are not working.

To Reproduce Steps to reproduce the behavior:

  1. Add "rmenu", "f24", "pause", or "mbutton" to whkdrc
  2. Start whkd

Expected behavior Keybindings work

Screenshots and Videos grafik

Operating System Microsoft Windows 10 Enterprise 10.0.19045, Build 19045

Additional context German keyboard layout

LGUG2Z commented 7 months ago

There is a section on the komorebi docs site about the exact format expected for key codes: https://lgug2z.github.io/komorebi/example-configurations.html#key-codes

I think it's worth adding this same snippet to the readme here for people who are planning to use whkd independently of komorebi.

F1orian commented 7 months ago

Thanks for the quick response, I'm actually formatting the keycodes according to the documentation, but without any luck: grafik grafik

LGUG2Z commented 7 months ago

I think I see the issue, which is related to restrictions in the Win32 API for registering hotkeys: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey

Only a valid fsModifier as listed in the Win32 docs can be used as a mod key. This should also be documented explicitly given how popular open source keyboard firmwares that allow remapping of keys like f24 have become now.

F1orian commented 7 months ago

That explains the issue! Thanks for clarifying!