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 |
Beta Was this translation helpful? Give feedback.
-
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). |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Create Keyboard Shortcuts with RxJS
The cleanest way to create and orchestrate Keyboard Shortcuts with RxJS.
https://notiz.dev/blog/simple-rxjs-keyboard-shortcuts
Beta Was this translation helpful? Give feedback.
All reactions