Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FB15168205: Global keyboard shortcuts (RegisterEventHotKey) with only Option or Option+Shift as modifiers do not work on macOS 15 #552

Open
sindresorhus opened this issue Sep 18, 2024 · 2 comments

Comments

@sindresorhus
Copy link
Member

  • Date: 2024-09-19
  • Resolution: Open
  • Area: AppKit
  • OS: macOS 15.0
  • Type: Incorrect/Unexpected Behavior

Description

Any sandboxed app that wants to support user customizable global keyboard shortcuts must use the old RegisterEventHotKey API. This works fine in macOS 14, but in macOS 15 final, keyboard shortcuts that only use Option or Option+Shift as modifiers no longer trigger the listener. For example: Option+D or Option+Shift+D

Reproduce:

  • Run the attached sample project
  • Click the text field and input "Option" and "D" together
  • Deselect the text field
  • Try pressing "Option" and "D" together
  • Notice that the emoji hand does not change, meaning the keyboard shortcut listener was not triggered

This used to work fine in macOS 14.6. You can run the sample project on macOS 14 too see that it works there.

More info here: sindresorhus/KeyboardShortcuts#176

The specific code for registering the shortcut is here: https://github.com/sindresorhus/KeyboardShortcuts/blob/main/Sources/KeyboardShortcuts/CarbonKeyboardShortcuts.swift

Observation: The keyboard shortcut starts working if I disable sandboxing in the sample project. That's obviously not a workaround though.

This is a critical regression and affects thousands of apps on the App Store. It affects any app that allow users to set a global keyboard shortcut, which is a lot.

Files

Sample project.zip

@sindresorhus
Copy link
Member Author

Looks like it's intentional: sindresorhus/KeyboardShortcuts#176 (comment)

@godbout
Copy link

godbout commented Sep 20, 2024

time to start not counting on my apps for my retirement...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants