We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to add enum support for all keys? I would also like an API so that several keys could be sent to the hotkey function like this
Old version:
hotkey({ key: 'Backspace', type: 'keydown', filter: timerModel.isRunning, target: clearClicked, }); hotkey({ key: 'Delete', type: 'keydown', filter: timerModel.isRunning, target: clearClicked, });
New version:
const HOTKEYS = { KEYDOWN: { BACKSPACE: 'keydown/backspace', DELETE: 'keydown/delete', }, KEYUP: { ESCAPE: 'keyup/escape', ENTER: 'keyup/enter', }, }; hotkey({ key: [HOTKEYS.KEYDOWN.BACKSPACE, HOTKEYS.KEYDOWN.DELETE], filter: timerModel.isRunning, target: clearClicked, });
The text was updated successfully, but these errors were encountered:
perhaps there are options with a better API, the main point here is that these key need to be typed
key
Sorry, something went wrong.
The thing is that there're not just hot "keys", but also combos. Like Ctrl+D So enums won't work well here, it should be something like
Ctrl+D
type Key = 'Ctrl' | 'Shift' | ... type Hotkey = `${Key}` | `${Key}+${Key}` | `${Key}+${Key}$+{Key}`
No branches or pull requests
Is it possible to add enum support for all keys? I would also like an API so that several keys could be sent to the hotkey function like this
Old version:
New version:
The text was updated successfully, but these errors were encountered: