Skip to content

Instantly share code, notes, and snippets.

@ova2
Last active January 12, 2025 20:26
Show Gist options
  • Save ova2/eaa7e41dad9eed7f3922f180cdd34894 to your computer and use it in GitHub Desktop.
Save ova2/eaa7e41dad9eed7f3922f180cdd34894 to your computer and use it in GitHub Desktop.
// register Shift key as shortcut
this._shortcutManager.shortcut$(ShortcutKey.Shift)
.pipe(takeUntil(this._destroy$$))
.subscribe(keyboardEvents => this.updateRoute(keyboardEvents));
// register W key as shortcut
this._subscription = this._shortcutManager.shortcut$(ShortcutKey.W)
.pipe(
// we're only interested in "keydown"
filter(keyboardEvents => keyboardEvents != null)
).subscribe(_ => this._tooltipService.hide());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment