I understood that the Tk keypress and keyrelease events were supposed only to fire when the key was actually pressed or released?
However with the following simple c
how about;
from Tkinter import * wn = Tk() wn.title('KeyDetect') m = 0 def down(e): if m == 0: print 'Down\n', e.char, '\n', e global m m = 1 def up(e): if m == 1: print 'Up\n', e.char, '\n', e global m m = 0 wn.bind('', down) wn.bind('', up) wn.mainloop()
now it won't repeat.