Skip to content

+, _, ;, Mod++, and a few other combo keys are unsupported #33

@AleksandrHovhannisyan

Description

@AleksandrHovhannisyan

TanStack Hotkeys version

v0.1.3

Framework/Library version

React v18.3.1

Describe the bug and the steps to reproduce it

// these work
useHotkey("=", () => {});
useHotkey("-", () => {});

// none of these work
useHotkey("+", () => {});
useHotkey("Mod++", () => {});
useHotkey("Mod+Shift+=", () => {});
useHotkey("_", () => {});
useHotkey("Mod+_", () => {});
useHotkey("Mod+Shift+-", () => {});

It should be possible to register these, although I assume Mod++ will prove tricky since + is used in the template literal types for chaining. But Mod+Shift+= does not work either.

We would like to use Mod+Shift+= and Mod+Shift+- in our code base.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/github/AleksandrHovhannisyan/useHotkey-bug-report/main?file=%2Fsrc%2Findex.tsx&workspaceId=ws_EYV7eQpntkPhtWonNS8z6x

Screenshots or Videos (Optional)

TypeScript error when trying to use the useHotkey hook with Mod++. Message: Argument of type 'Mod++' is not assignable to parameter of type 'RegisterableHotkey'

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions