Create Keyboard Shortcuts with RxJS #203
Replies: 3 comments
|
Hello Gary, thx for your awesome article. Is there an easy way to exclude keys from beeing pressed at the same time? Example: If you have two key combinations like |
|
When I add these two shortcuts, there was some error shortcut([KeyCode.ControlLeft, KeyCode.KeyZ]).subscribe( console.log('a')); If I type "ctrl + shift + z" then "ctrl + z" shortcut works together with "ctrl +shift +z" short so I add some code to fix it */ // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type) // Create KeyboardEvent Observable for specified KeyCode // Create Event Stream for every KeyCode in shortcut // Emit when specified keys are pressed (keydown). |
|
Gary, great article! I want to adopt the solution for my project. But why do we need to observe both keydown and keyup events? Is it not enough to observe keydown only? Thanks in advance for your response. |
Uh oh!
There was an error while loading. Please reload this page.
Create Keyboard Shortcuts with RxJS
The cleanest way to create and orchestrate Keyboard Shortcuts with RxJS.
https://notiz.dev/blog/simple-rxjs-keyboard-shortcuts
All reactions