![]() I could foresee user-facing options for whether to prefer characters or charactersIgnoringModifiers, but it's more subtle and surprising than one might guess. I attempted to explain this in a previous comment. Referring back to the original post, ⇧7 is not really a "shortcut", it is a keystroke which results in & being inputted via a keyboard event. ![]() It's only when control, option, or command are added to the keystroke that it's seen as a command key event with both the shifted and unshifted key provided in the event information. That's literally how it is represented in the internal CGEvent/NSEvent generated for each keystroke. So, ⇧7 is technically just & on a US keyboard layout. We'd welcome any help or feedback from folks with locale and keyboard layout expertise on this one, but I doubt the raw shift-7 case is one we'd be able to support, at least not without a ton of special casing. And the layout of modified keys also differs across locales & keyboard layouts in ways we can't entirely predict. In other words, the shift key is accounted for differently depending on whether other modifiers are used. What's interesting is that for cmd-shift-7 we receive 7 for characters and & for charactersIgnoringModifiers. In your specific case, for shift-7, what comes through the event is literally & for both the event's characters and charactersIgnoringModifiers properties. Unfortunately there are some limitations of what's possible here, I recall from having investigated quite some time ago. ultimately we should consolidate and continue the conversation is right, time to devote to this has been very limited lately, but this is one I have been looking into.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |