基本です。.bindでkeyが打たれたときの状態を感知することができます。 import tkinter as tk root = tk.Tk() def key_event(e): print(e.keysym) root.bind("<KeyPress>", key_event) root.mainloop() このコードを実行してキーボードを叩けばprint関数で打ったkeyが出力されます。
Continuing the exploration of using Tkinter with Python, this version adds catching 'Tab' or 'Return' keypress within the 'Entry' widget.
A quick and simple python script I took from samiamsam.com and tweaked to work with 8841 model Cisco IP phones. http://samiamsam.com/2014/04/16/cisco-uc-devops-series ...