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
+11
View File
@@ -0,0 +1,11 @@
---
"global-shortcut": "patch"
"global-shortcut-js": "patch"
---
Refactored APIs to introduce new pressed and released events:
- Added `ShortcutEvent` and `ShortcutState` types in Rust.
- Changed the handler function passed to `GlobalShortcut::on_shortcut`, `GlobalShortcut::on_all_shortcuts` and `Builder::with_handler` to take a 3rd argument of type `ShortcutEvent`.
- Added `ShortcutEvent` interface in JS.
- Changed `ShortcutHandler` type alias (which affects the JS `register` and `registerAll` APIs) to take `ShortcutEvent` instead of a string.