-
-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
When I register a media key like PhysicalKeyboardKey.mediaPlayPause with system scope, I get the error:
Could not cast value of type 'NSNull' (0x14e87f280) to 'NSNumber' (0x1f459cdd8).
and the app terminates. I can register such keys with the scope inapp without a crash, but then I don't get any events in the keyDownHandler or keyUpHandler. On the other side, I'm able to register i.e. a hotkey for F9 with system scope that does work as expected.
When I use LogicalKeyboardKey.mediaPlayPause instead, the behavior and error message is the same (only the value of NSNull is slightly different).
Please let me know if further details are needed.
HotKey playPauseHK = HotKey(key: PhysicalKeyboardKey.mediaPlayPause, modifiers: [], scope: HotKeyScope.system);
await hotKeyManager.register(
playPauseHK,
keyDownHandler: (key) {
debugPrint('PlayPause down: ${key.toJson()}');
},
keyUpHandler: (key) {
debugPrint('PlayPause up: ${key.toJson()}');
},
);
Metadata
Metadata
Assignees
Labels
No labels