[issue42640] tkinter throws exception when key is pressed

Justin report at bugs.python.org
Mon Dec 14 13:24:18 EST 2020


Justin <justin.a.black at gmail.com> added the comment:

Sorry my verification keyboard listener program is not the pygame one. It is this one:
```
from tkinter import *
def keyup(e):
    print('up', e.__dict__)
def keydown(e):
    print('down', e.__dict__)

root = Tk()
frame = Frame(root, width=100, height=100)
frame.bind("<KeyPress>", keydown)
frame.bind("<KeyRelease>", keyup)
frame.pack()
frame.focus_set()
root.mainloop()
```

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42640>
_______________________________________


More information about the Python-bugs-list mailing list