fix: don't register some shortcuts without accessibility (#16125)
Fixed crash on macOS when using globalShortcut for media keys when accessibility access is not granted.
This commit is contained in:
parent
b57046e67d
commit
876064036d
4 changed files with 59 additions and 3 deletions
|
@ -54,6 +54,14 @@ When the accelerator is already taken by other applications, this call will
|
|||
silently fail. This behavior is intended by operating systems, since they don't
|
||||
want applications to fight for global shortcuts.
|
||||
|
||||
The following accelerators will not be registered successfully on macOS 10.14 Mojave unless
|
||||
the app has been authorized as a [trusted accessibility client](https://developer.apple.com/library/archive/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTestingApps.html):
|
||||
|
||||
* "Media Play/Pause"
|
||||
* "Media Next Track"
|
||||
* "Media Previous Track"
|
||||
* "Media Stop"
|
||||
|
||||
### `globalShortcut.registerAll(accelerators, callback)`
|
||||
|
||||
* `accelerators` String[] - an array of [Accelerator](accelerator.md)s.
|
||||
|
@ -65,6 +73,14 @@ When a given accelerator is already taken by other applications, this call will
|
|||
silently fail. This behavior is intended by operating systems, since they don't
|
||||
want applications to fight for global shortcuts.
|
||||
|
||||
The following accelerators will not be registered successfully on macOS 10.14 Mojave unless
|
||||
the app has been authorized as a [trusted accessibility client](https://developer.apple.com/library/archive/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTestingApps.html):
|
||||
|
||||
* "Media Play/Pause"
|
||||
* "Media Next Track"
|
||||
* "Media Previous Track"
|
||||
* "Media Stop"
|
||||
|
||||
### `globalShortcut.isRegistered(accelerator)`
|
||||
|
||||
* `accelerator` [Accelerator](accelerator.md)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue