feat(global-shortcut): support pressed/released states (#1244)

closes #1243
This commit is contained in:
Amr Bashir
2024-04-24 15:42:01 +02:00
committed by GitHub
parent a9132161df
commit 9c7eb35967
18 changed files with 86 additions and 41 deletions
+2 -2
View File
@@ -12,8 +12,8 @@
function register() {
const shortcut_ = shortcut;
registerShortcut(shortcut_, () => {
onMessage(`Shortcut ${shortcut_} triggered`);
registerShortcut(shortcut_, (e) => {
onMessage(`Shortcut ${shortcut_} triggered ${e.state}`);
})
.then(() => {
shortcuts.update((shortcuts_) => [...shortcuts_, shortcut_]);