How do I get th开发者_开发问答e 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.
精彩评论