Simulator 3.0.0 omits key events that used to be supported

I use the keyPressed handler pretty extensively for debug purposes. OS X Simulator 3.0.0 (and possibly earlier, I’m not sure) no longer triggers all the events of previous versions. For example, I have actions mapped to the , and . keys to cycle through information, and complementary actions mapped to < and > (same key, with SHIFT modifier) to cycle through information in an alternate way. The keyPressed handler no longer triggers for the modified keys. Instead, these combinations result in a system “beep” to signify that the input isn’t handled. Why were these removed? With limited keys, it was very useful to be able to check for upper/lower, or for alternate characters, even without the ability to explicitly check for modifier keys independently.

I've got that filed, aiming to have a fix in for 3.0.2.

1 Like

That’s great, thanks!

Hey Dave, I see a related item in the release notes for 3.0.2:

Simulator: Changed some keyboard shortcuts to better match prior macOS Simulator/use platform modifier key

Was that change intended to resolve this issue? (And if not, what was the nature of that change?) I’m still unable to capture key events with SHIFT or OPTION modifiers on Simulator 3.0.2. To be explicit, I’m expecting the key argument of keyPressed() to change based on the modifier. Using the period key as an example:

  • period (no modifier): .
  • option + period:
  • shift + period: >
  • and for completeness, option + shift + period: ˘

These are the characters that are typed with those key combinations, and which used to be distinguishable in keyPressed() by comparing against them. Now any key combos with SHIFT or OPTION modifiers produce a system beep and do not trigger the callback.

I’ll add that the above is my expectation based on the previous behavior of that callback. My use case would also be satisfied if the callback was updated to provide flag arguments (or a bitmask) to indicate which modifiers apply to the event.