react-hotkeys icon indicating copy to clipboard operation
react-hotkeys copied to clipboard

[BUG] Pressing Ctrl+ALT+[A number] keep the key in the combination until focus out.

Open e-gauthier opened this issue 4 years ago โ€ข 0 comments

Describe the bug Consider the CodeSandbox for reproduction.

Pressing CTRL+ALT+[Any number], keep the pressed characters as combination until focus out.

My keyboard configuration is Canadian French, the problem doesn't occur if you need to press Shift+2 to create a @.

How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc) HotKeys

Expected behavior In my opinion, pressing CTRL+ALT+[Any number] should be interpreted as a unique key and not as a combination for other keys.

Platform (please complete the following information):

  • Version of react-hotkeys 2.000
  • Browser : Edge and Chrome
  • OS: Win 10

Are you willing and able to create a PR request to fix this issue? Yes, with guidance.

Include the smallest log that includes your issue:

I used logLevel : Debug. LogLevel can be set in the codeSandbox for further info.

Pressing "a" then "@" and finally "Enter" will produce the log below.

HotKeys (F5๐Ÿ“—-C1โญ๏ธ-P0๐Ÿ”บ:) Focused. HotKeys (F5๐Ÿ“—-E61๐Ÿ’š-C1โญ๏ธ-P0๐Ÿ”บ:) New 'a' keydown event. HotKeys (F5๐Ÿ“—-E61๐Ÿ’š-C0๐Ÿ”บ) No matching actions found for 'a' keydown. HotKeys (F5๐Ÿ“—-E62๐Ÿ’™-C1โญ๏ธ-P0๐Ÿ”บ:) New 'a' keypress event. HotKeys (F5๐Ÿ“—-E63๐Ÿ’›-C1โญ๏ธ-P0๐Ÿ”บ:) New 'a' keyup event. HotKeys (F5๐Ÿ“—-E64๐Ÿ’œ-C1โญ๏ธ-P0๐Ÿ”บ:) New 'Control' keydown event. HotKeys (F5๐Ÿ“—-E64๐Ÿ’œ-C0๐Ÿ”บ) No matching actions found for 'Control' keydown. HotKeys (F5๐Ÿ“—-E66โค๏ธ-C1โญ๏ธ-P0๐Ÿ”บ:) New (simulated) 'Control' keypress event. HotKeys (F5๐Ÿ“—-E67๐Ÿ’š-C1โญ๏ธ-P0๐Ÿ”บ:) New 'Alt' keydown event. HotKeys (F5๐Ÿ“—-E67๐Ÿ’š-C0๐Ÿ”บ) No matching actions found for 'Alt+Control' keydown. HotKeys (F5๐Ÿ“—-E69๐Ÿ’›-C1โญ๏ธ-P0๐Ÿ”บ:) New (simulated) 'Alt' keypress event. HotKeys (F5๐Ÿ“—-E70๐Ÿ’œ-C1โญ๏ธ-P0๐Ÿ”บ:) New '@' keydown event. HotKeys (F5๐Ÿ“—-E70๐Ÿ’œ-C0๐Ÿ”บ) No matching actions found for '@+Alt+Control' keydown. HotKeys (F5๐Ÿ“—-E71๐Ÿงก-C1โญ๏ธ-P0๐Ÿ”บ:) New '@' keypress event. HotKeys (F5๐Ÿ“—-E72โค๏ธ-C1โญ๏ธ-P0๐Ÿ”บ:) New '2' keyup event. HotKeys (F5๐Ÿ“—-E73๐Ÿ’š-C1โญ๏ธ-P0๐Ÿ”บ:) New 'Alt' keyup event. HotKeys (F5๐Ÿ“—-E74๐Ÿ’™-C1โญ๏ธ-P0๐Ÿ”บ:) New 'Control' keyup event. HotKeys (F5๐Ÿ“—-E75๐Ÿ’›-C1โญ๏ธ-P0๐Ÿ”บ:) New 'b' keydown event. HotKeys (F5๐Ÿ“—-E75๐Ÿ’›-C0๐Ÿ”บ) No matching actions found for '@+b' keydown. HotKeys (F5๐Ÿ“—-E76๐Ÿ’œ-C1โญ๏ธ-P0๐Ÿ”บ:) New 'b' keypress event. HotKeys (F5๐Ÿ“—-E77๐Ÿงก-C1โญ๏ธ-P0๐Ÿ”บ:) New 'b' keyup event. HotKeys (F5๐Ÿ“—-E78โค๏ธ-C1โญ๏ธ-P0๐Ÿ”บ:) New 'Enter' keydown event. HotKeys (F5๐Ÿ“—-E78โค๏ธ-C0๐Ÿ”บ) No matching actions found for '@+Enter' keydown. <=== Here is the problem. HotKeys (F5๐Ÿ“—-E80๐Ÿ’™-C1โญ๏ธ-P0๐Ÿ”บ:) New (simulated) 'Enter' keypress event. HotKeys (F5๐Ÿ“—-E80๐Ÿ’™-C1โญ๏ธ-P0๐Ÿ”บ:) Ignored 'Enter' keypress as it was not expected, and has already been simulated. HotKeys (F5๐Ÿ“—-E80๐Ÿ’™-Cnull๐Ÿ”บ) Stopping further event propagation.

Here is another version with multiple CTRL+ALT+[1 to 6] HotKeys (F7๐Ÿ“™-E156โค๏ธ-C0๐Ÿ”บ) No matching actions found for '@+Enter+ยข+ยฃ+ยค+ยฆ+ยฌ' keydown.

What Configuration options are you using? None

e-gauthier avatar Aug 17 '21 20:08 e-gauthier