JohannesKlauss / react-hotkeys-hook

React hook for using keyboard shortcuts in components.
https://react-hotkeys-hook.vercel.app/
MIT License
2.72k stars 115 forks source link

[BUG] Issue with shift + ` / backtick / backquote / intlbackslash #947

Open adam-lynch opened 1 year ago

adam-lynch commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Listen to shift+`
  2. Hold down shift, press and let go of `. The callback does not fire.

Expected behavior

The callback fires.

Screenshots N/A

Desktop (please complete the following information):

Additional context

It seems to work if I press it in the opposite order; hold down `, press and let go of shift.

I've stepped through the code a little bit in the debugger and I saw intlbackslash mentioned. I tried modifying my listeners to use intlbackslash instead of ` and they all work; i.e. and shift+.

I'm using an M1 Macbook Pro with the Irish keyboard layout;

image

(` is in the bottom left)

JohannesKlauss commented 1 year ago

Can you please tell me what the console output is on this codesandbox is when you are pressing that combination?

adam-lynch commented 1 year ago
image image
JohannesKlauss commented 9 months ago

This is a layout specific problem that gets addressed in version 5.

This has been fixed in pre release 5.0.0-1. Please try out this version. To listen to `` use you just useuseHotkeys('', callback, {useKey: true})

Please let me know if that fixes your issue.