Skip to content

v1.0.2

Choose a tag to compare

@debabin debabin released this 29 Jun 08:38
· 108 commits to main since this release

Fix useHotkeys hook

This release fixes a stuck-key bug in useHotkeys and reworks hotkey matching to read modifiers directly from the keyboard event.

Fixes

  • useHotkeys β€” fixed a bug where keys could get stuck and the hotkey would stop firing. On macOS, releasing Cmd doesn't dispatch keyup for the regular keys held with it, so the previously pressed keys stayed in the accumulator forever. Modifiers are now read directly from the event flags (event.ctrlKey, event.metaKey, etc.) instead of being accumulated across events, so the bug is gone by design.
  • useHotkeys β€” fixed the callback firing twice for a single press. The hook now listens only to keydown instead of both keydown and keyup.
  • useHotkeys β€” fixed key normalization where special keys (space, escape, enter, arrows, etc.) could fail to match because the lookup ran against the raw key instead of the normalized one.
  • useHotkeys β€” added the mod modifier (ctrl on Windows/Linux, meta on macOS) and modifier aliases (control, cmd, command) for cross-platform hotkeys.