How to check which key is released in modifierKeysChanged?

There is nice method modifierKeysChanged(), but I’ve fount it can only check which key is pressed down.
And modifierKeysChanged() is called also when I release key, but I don’t know how to check which key is released.
So for example I assume if I have if statement like that:
if ( ! modifiers.isCommandDown() ) it will pass if I press “alt” key and all other keys.

Is there any method to check which key is released?

I think you would have to manually keep track of the state yourself, maybe even using the keyPressed() method as well in this case.

What is it you’re trying to do based on the state of the modifier key? Usually I just handle any modifiers directly when I need them, such as in keyboard event or mouse event callbacks. I haven’t really had to make use of modifierKeysChanged() before

1 Like

Thanks for your advice