Key Listener KeyPressed() inconsistencies - incorrect keyCharacter

Hi,
I am implementing some undo functionality for some of the more advanced parameter changes that don’t use a simple slider.
This requires that the Editor inherits from KeyListener and waits for a Cmd+Z/Ctrl+Z message.
When i press only “z” on my keyboard you can see that the text character is passed correctly.

However when I add a modifirer key, i.e. CommandModifier this happens:
image
This is still pressing “z” character on my keyboard, the textCharacter is not correct. I have tested with other keys and the result is the same:
no modifier keys - text character is correct
with any modifier - text character is garbage

Am I missing something here?

I tried this with the Component “KeyPressed” but that seemed to always take away keyboard focus. The Component KeyPressed() was able to extract the textCharacter fine with modifier keys. I want the keyboard focus to remain on host so I can play/pause without having to leave the plugin window.

Can you use the keyCode instead? From the header file:

@param textCharacter the character that would be printed if someone typed
this keypress into a text editor. This value may be
null if the keypress is a non-printing character
So the null character is expected here, because Command+Z is not a valid printable character.