For my application I need to capture keycodes during GUI configuration and store them in a config file. This is all very easily done in Juce.
However, I later want to synthesise events that simulate those key presses. Reading juce_mac_NSViewComponentPeer.mm however, it seems that the juce::KeyPress keyCode is not the key code of the native system event, which obviously makes sense. Sadly though, the native key code is lost at this time and I can’t get access to it. I could try to reverse-synthesise the keycode from the character keycode that Juce uses, but that seems so much work for information that was there all along.
Does anyone have a good idea about how to preserve the native key code? I could modify the Juce KeyPress class and add a nativeKeyCode field to it, but I’d rather not stray from the Juce mainline.
Any thoughts? Jules, would you accept a patch back like this that preserves the original keycode throughout as a separate field?
Thank for the help,