palantir/blueprint

HotkeyProvider doesn't work with F1-F12 keys

Open

#6508 opened on Nov 5, 2023

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)batch import
Domain: documentationP3Package: coreType: enhancementhelp wanted

Description

Environment

  • Package version(s): Core 5.6.0
  • Operating System: Windows 11
  • Browser name and version: Google Chrome 119.0.6045.105

Code Sandbox

Link to a minimal repro.

Steps to reproduce

  1. Assign a combo to one of the F1-F12 keys.
  2. Press said button.
  3. Done.

Actual behavior

F1-F12 cannot be asigned as combo values. When I press a value the onKeyDown function is never called.

Expected behavior

When I press F1-F12 it should call the keydown function.

Possible solution

I believe the issue comes because the combo checker checks if the first letter of a combo is a-z so it uses Key<Code>, which probably makes F1 do things as KeyF1 instead of the proper key code.

Contributor guide