#coding=utf-8 from tkinter import * root=Tk() def callback(event): print("点击键盘",repr(event.char)) frame=Frame(root,width=200,height=200) frame.bind("<Key>",callback) frame.focus_set() frame.pack() mainloop()
效果图:
原文地址:https://www.cnblogs.com/sea-stream/p/10989679.html
时间: 2024-10-01 12:20:12