Skip to content

[BUG] Hotkeys for some punctuation marks do not work, with or without useKey #1269

@joelspadin

Description

@joelspadin

Describe the bug
Based on the documentation, I would expect each of the following to work:

useHotkeys('<', () => {}, { useKey: true }, []);
useHotkeys('>', () => {}, { useKey: true }, []);
useHotkeys('+', () => {}, { useKey: true, delimiter: '_' }, []);

however, only the first one does.

There are some other unexpected behaviors as well. Using a US layout keyboard:

  • shift+, does not trigger, with or without useKey, when pressing shift+, or just ,. shift+Comma does work as expected.
  • shift+. with useKey triggers only when pressing . without holding shift. shift+Period does work as expected.
  • shift+. without useKey never triggers.
  • shift+= with useKey triggers only when pressing = without holding shift. shift+Equal does work as expected.
    • shift+= without useKey never triggers.

To Reproduce

Create a hotkey that uses > or + (with the delimiter changed to be something else)

useHotkeys('>', () => {}, { useKey: true }, []);
useHotkeys('+', () => {}, { useKey: true, delimiter: '_' }, []);

Please try and add a codesandbox or stackblitz to reproduce the bug:
https://codesandbox.io/p/sandbox/qwhrs6

Here is a codesandbox template that you can use to recreate a minimal example
https://codesandbox.io/p/sandbox/adoring-shape-bzvk53

Expected behavior
The hotkeys should trigger when shift+. or shift+= are pressed.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Edge version 137.0.3296.68, Firefox version 139.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions