On Tue, 14 Nov 2023 16:52:16 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> A KeyCharacterCombination should match a key if the target character is >> printed on that key. For example, the user should be able to invoke the >> `Shortcut+'+' ` combination by holding down the Shortcut key and pressing a >> key that has '+' printed on it. This should work even if '+' is a shifted >> symbol but the user doesn't hold down the Shift key. >> >> The Mac implements KeyCharacterCombinations by monitoring keystrokes to >> discover the relationship between keys and characters. Currently the system >> only records the character the user typed and no other characters on the >> same key. This means a shortcut targeting a shifted character may not work >> until the user types that character using Shift so the system learns the >> relationship. >> >> This PR keeps the same mechanism in place but always records the shifted and >> unshifted character for each keystroke. >> >> For the Mac the KeyboardTest app was modified to remove tests for characters >> accessed using Option. We don't look for these characters because under the >> hood just about every key has some symbol assigned to the Option modifier >> that the user probably isn't even aware of. For these character we fall back >> to the existing logic; once the user types the character it will start >> working as a shortcut. > > It looks like the scope of this change went beyond the original problem in > JBS. > Would it be possible to update the JBS ticket with the information in this PR > description? @andy-goryachev-oracle You're right, this PR also deals with the problem of the map retaining stale entries when the user switches layout. I added details about this to the JBS ticket. We could treat it as a separate bug if you want, to me it's just the sort of standard housekeeping one does when caching information. I also added a note about the KeyboardTest app. This PR scales back that test a bit but this is the first time we've been able to run the KeyCharacterCombinations on the Mac so that portion is basically a new test. Let me know if you want further information in the JBS ticket. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1209#issuecomment-1811194141