Magnet icon indicating copy to clipboard operation
Magnet copied to clipboard

Change keyEquivalent to show the typed character, not the QWERTY key cap label

Open DivineDominion opened this issue 5 years ago • 3 comments

Magnet does a great job translating the character of the pressed key into a key code and a "physical" key label. This PR changes property names to avoid confusion:

  • Renames the label of a KeyCombo that corresponds to a QWERTY keyboard key to qwertyKeyLabel
  • Changed keyEquivalent to produce a String that corresponds to the actual text character that results from pressing the key, which is needed for NSMenuItem and similar Cocoa/AppKit functionality

For users of Magnet that use KeyCombo for menu item shortcuts (like me), this means that the NSMenuItem.keyEquivalent needs to be updated when the keyboard layout is changed by the user, e.g. from QWERTY to DVORAK. This PR helps by aligning the meaning of "keyEquivalent" for this.

DivineDominion avatar Apr 06 '21 13:04 DivineDominion

Updated for the latest changes to Sauce etc.

@Econa77 I'm not 100% certain I caught your intention with this PR. And maybe my description is confusing. Would be happy to discuss alternatives!

DivineDominion avatar Apr 12 '21 07:04 DivineDominion

@Econa77 Just wanted to check if you want to move forward with this

DivineDominion avatar Aug 05 '22 15:08 DivineDominion

@Econa77 Since you merged another PR recently, maybe you could look into this?

DivineDominion avatar Oct 13 '23 14:10 DivineDominion