Movatterモバイル変換
[0]ホーム
Can you capture Key-Release events in Tkinter?
Fredrik Lundhfredrik at pythonware.com
Tue Apr 24 12:44:00 EDT 2001
Nick Perkins wrote:> I am trying to make a little interactive game using> Tkinter Canvas widget. (Python 2.0 - win NT - PythonWin..)>> It seems that only KeyPress events are available, and not key-release> events. Is this a limitation of Tk itself, or a limitation of Tkinter, or is> there a way to do it?this works for me:from Tkinter import *c = Canvas()c.pack()# make sure we see all keyboard eventsc.focus_set()def release(event): print "release", event.keysymc.bind("<KeyRelease>", release)mainloop()Cheers /F
More information about the Python-listmailing list
[8]ページ先頭