Вопрос

What's the Linux version of "<Control-Shift-u>" for keybindings in Tkinter? You might be tempted to think it's exactly that, but, alas, it does not seem to be. For instance, the Linux version of "<Control-Shift-Tab>" is "<Control-ISO_Left_Tab>". I've searched and haven't found any documentation for this.

Это было полезно?

Решение

The following will do what you want:

from Tkinter import *

def proof(event=None):
    print 'ping'

root = Tk()

frame = Frame(root, height=100, width=100)
frame.focus_set()
frame.bind('<Control-Shift-KeyPress-U>', proof)
frame.pack()

root.mainloop()

The u becomes capitalized because of the shift modifier and you want to capture the KeyPress event.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top