How do I get the full name of an event? For example, Event.keysym
only shows "c" for an event triggered by "<Control-c>"
. How can I get the "Control" too?
Event.state holds the OR'd together states of the modifier keys. So you could try something like:
modifiers = []
if event.state & 1:
modifiers.append('Shift')
if event.state & 4:
modifiers.append('Control')
# ... etc
print '-'.join(modifiers)
See here for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With