JohannesKlauss / react-hotkeys-hook

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

[BUG] `option` Key No Longer Registers in v4? #1119

Closed benshope closed 6 months ago

benshope commented 6 months ago

Describe the bug The word option (as in option+a) no longer works for mac key commands after upgrading to v4. It seems the hokey must be alt (as in alt+a) to work on mac. This may be intentional but I'm not seeing it in the docs.

To Reproduce Steps to reproduce the behavior:

  1. Go to this codepen
  2. Press the option+b
  3. The alert does not fire

Please try and add a codesandbox or stackblitz to reproduce the bug: Codepen

Expected behavior I expected the hotkey to register for option+b

Screenshots n/a

Desktop (please complete the following information):

Additional context n/a

JohannesKlauss commented 6 months ago

It's referred to in the info box here: https://react-hotkeys-hook.vercel.app/docs/documentation/useHotkeys/basic-usage#multiple-hotkeys

So this is intentional in effort to reduce friction between different os environments.

benshope commented 6 months ago

@JohannesKlauss thanks for the quick response - the docs say

Since version 4 alt and option are identical

when it might be more accurate to say

Since version 4 option is deprecated in favor of alt. option no longer triggers hotkeys