Skip to content

fix: macOS shortcut handling#915

Merged
PartyDonut merged 2 commits intoDonutWare:developfrom
schembriaiden:fix/macos-shortcuts
Apr 6, 2026
Merged

fix: macOS shortcut handling#915
PartyDonut merged 2 commits intoDonutWare:developfrom
schembriaiden:fix/macos-shortcuts

Conversation

@schembriaiden
Copy link
Copy Markdown
Contributor

Pull Request Description

This pull request improves the flexibility and accuracy of keyboard shortcut handling by enhancing how modifier keys are compared and recognized. The main changes introduce a new method for matching modifier keys, expand support for "super" keys, and update the logic for detecting key combinations throughout the codebase.

Key combination logic improvements:

  • Added the modifierMatches static method to KeyCombination to allow comparison of modifier keys by their functional group (shift, alt, ctrl, super), not just by exact key identity. This enables consistent recognition of different physical keys that serve the same modifier function (e.g., left/right shift, meta, super).
  • Updated the containsSameSet method in KeyCombination to use modifierMatches for more robust comparison of key combinations.
  • Expanded the set of recognized modifier keys by introducing superKeys (including meta and super keys) and incorporating them into the modifierKeys set.

Input handling updates:

  • Modified _InputHandlerState in input_handler.dart to use KeyCombination.modifierMatches when checking if a pressed modifier key matches a configured modifier, ensuring consistent behavior with the new comparison logic.

Previous PR (#901) did not fix the issue as when I tried the nightly build on my Macbook the fix did not work.

Issue Being Fixed

Resolves #882

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

Copy link
Copy Markdown
Collaborator

@PartyDonut PartyDonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very strange, I just tested it and for some reason the "super/command" + q combination does work on my laptop keyboard but not on my external keyboard. Despite being the same keys on the same side.

That being said, the changes look ok. But lets keep the shift/ctrl/alt left and right modifier keys separate. I think we should only combine the super/meta left and right keys.

@schembriaiden
Copy link
Copy Markdown
Contributor Author

schembriaiden commented Apr 6, 2026

Very strange, I just tested it and for some reason the "super/command" + q combination does work on my laptop keyboard but not on my external keyboard. Despite being the same keys.

I have no idea what might be causing it. I have an M1 Macbook Air. Might be some differences in the OS/drivers between variants I guess.

That being said, the changes look ok. But lets keep the shift/ctrl/alt left and right modifier keys separate. I think we should only combine the super/meta left and right keys.

Should be fixed.

Copy link
Copy Markdown
Collaborator

@PartyDonut PartyDonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the lightning quick fix!

I have no idea what might be causing it. I have an M1 Macbook Air. Might be some differences in the OS/drivers
between variants I guess.

M2 air here so should not be that different. I do have the international keyboard version not sure if that changes anything.

@PartyDonut PartyDonut merged commit e63a1df into DonutWare:develop Apr 6, 2026
1 check passed
@PartyDonut PartyDonut added the bug Something isn't working label Apr 6, 2026
@schembriaiden schembriaiden deleted the fix/macos-shortcuts branch April 6, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⌘+Q not closing the app on Mac

2 participants