tauri-apps / global-hotkey

Global hotkeys for Desktop Applications.
Apache License 2.0
130 stars 17 forks source link

feat: support `Backquote` key #41

Closed melMass closed 10 months ago

melMass commented 10 months ago

Hi,

I'm trying to debug the proper keycode for the key at the left of the 1 in the top row of an azerty keyboard. I tried Backslash (this is mapped to ><), Backquote (this is mapped to the proper backquote on azerty), and a few others that failed to register altogether. Is there a way to register all supported keycodes in order to debug that?

Thanks for the lib really useful and it also integrates well with slint-ui

amrbashir commented 10 months ago

There is a lot of keys that we don't support out of the box and hopefully we can add gradually.

I did some research and found the keys that we need to use: Windows: VK_OEM_3 https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes Linux (X11): XK_quoteleft https://docs.rs/x11-dl/latest/x11_dl/keysym/constant.XK_quoteleft.html

@pewsheen can you check what is the code for Backquote on macOS?

pewsheen commented 10 months ago

There is a lot of keys that we don't support out of the box and hopefully we can add gradually.

I did some research and found the keys that we need to use: Windows: VK_OEM_3 https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes Linux (X11): XK_quoteleft https://docs.rs/x11-dl/latest/x11_dl/keysym/constant.XK_quoteleft.html

@pewsheen can you check what is the code for Backquote on macOS?

Should be kVK_ANSI_Grave (0x32)

amrbashir commented 10 months ago

Looks like we already support this key on Windows and macOS, what platform did you test this on? or does it work on some layouts while others don't?

melMass commented 10 months ago

Looks like we already support this key on Windows and macOS, what platform did you test this on? or does it work on some layouts while others don't?

amrbashir commented 10 months ago

I see, I think that's the expected behavior when you change layout. Windows also behaves this way, so I will go ahead and add the key to Linux as well and then I will mark this issue as solved.