blueprint icon indicating copy to clipboard operation
blueprint copied to clipboard

HotKey: Can't use NumPad Plus

Open nturley opened this issue 4 years ago • 3 comments

Environment

  • Package version(s): 3.18.1
  • Browser and OS versions: Chrome Windows 10

If possible, link to a minimal repro: https://codesandbox.io/embed/serene-sara-g4umn

Steps to reproduce

Use "plus" as a key in a Hotkey

Actual behavior

The plus key by the numpad doesn't work for hotkeys

Expected behavior

The plus key by the numpad works for hotkeys.

Possible solution

The plus key is unique on qwerty keyboards because it is on the keyboard twice and one of them is a shift key and the other is not. That isn't true on my keyboard with any other key.

When parsing the key combination of "plus", hotkeyParser.ts looks up whether it is a shift key and replaces it with the non-shifted key and adds the modifier so it replaces plus with equals and adds the shift modifier.

An easy fix would be to add a new name for the numpad plus that has the same key code of 107, but is not present in the ShiftKey lookup table so that it doesn't get replaced with "shift + =". That would force devs to have a hotkey for each plus.

More invasive solutions might involve having parseKeyCombo return an array of keyCombos instead of a single keyCombo, or writing some special logic just for plus.

nturley avatar Sep 13 '19 19:09 nturley