Key event handling
See original GitHub issuesupport for combinations and multiple keys for one action.
With the new api it should be possible to pass a single value, an array for multiple possibilities and a combination of keys marked with a plus sign.
Old api:
deleteKeyCode="Backspace"
deleteKeyCode={8}
new api:
deleteKeyCode="Backspace"
deleteKeyCode={['Backspace', 'Delete']}
deleteKeyCode="Meta+Delete"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
KeyboardEvent - Web APIs | MDN
KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key ...
Read more >How to Write a Key Listener
Key events indicate when the user is typing at the keyboard. Specifically, key events are fired by the component with the keyboard focus...
Read more >The KeyboardEvent
Events that occur when user presses a key on the keyboard, belongs to the KeyboardEvent Object. KeyboardEvent Properties and Methods. Property/Method ...
Read more >JavaScript Keyboard Events Explained
The keyboard event has two important properties: key and code . The key property returns the character that has been pressed whereas the...
Read more >Handling Key Events
Cocoa Event Handling Guide · Preparing a Custom View for Receiving Events · Implementing Action Methods · Getting the Location of an Event...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

There will be so many changes 😄 Maybe it would be good if we could keep the simple string API (we will already drop the
key(number) API). Your idea to use a nested array for combinations is good.What about this API?
We could even leave deleteKeyCode as is to keep backward compatibility. This also allows for three key combos and should be easier/cleaner to define in TypeScript. But of course we could also use template literal types, if we use your API suggestion.