Catching modifiers on keyup events

According to the Keyboard page in the manual:

I thought that implied that I could catch keyup events with those modifiers, too, such as “control-a-up”. Those events aren’t being caught in my program, though. I have verified that exactly that string is being send to the accept() function.

Is it possible to catch modifiers in combination with a keyup event? Thanks!

Modifiers are not sent with the keyup event, only with the keydown event. The reasoning is that with the keyup event, there’s no guarantee that the modifier is still held. (If I press control-A, and then release it, I might release the control key before I release the A key.) So for the purposes of tracking a key up motion, it’s better not to rely on the modifier keys still being held.

If you want to know when I released the control-A key, you should set a flag when you received the control-A keydown event, and then when you receive the A key up event you know that I have released control-A.


Thank you for the clarification. I’ll use a different strategy this time I guess :slight_smile: