I made simple script:
from tkinter import *
class MyFrame(Frame):
def __init__(self, parent = None):
Frame.__init__(self, parent, bg = 'red')
self.pack(fill=BOTH, expand=YES)
self.bind('<Key>', lambda e: print("pressed any key"))
root = Tk()
root.geometry("300x200")
f = MyFrame(root)
root.mainloop()
But binding for pressing any key do not work. Nothing happens whey I press any key. Do you know why?