diff options
Diffstat (limited to 'pypers/bolzano/gui/keys.py')
-rwxr-xr-x | pypers/bolzano/gui/keys.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pypers/bolzano/gui/keys.py b/pypers/bolzano/gui/keys.py new file mode 100755 index 0000000..bc1d9de --- /dev/null +++ b/pypers/bolzano/gui/keys.py @@ -0,0 +1,15 @@ +from Tkinter import * + +class Output(Label): + def printkey(self, event): + self.config(text=event.keysym) + +root = Tk() +label = Label(root, text='Press a key...') +output = Output(root, takefocus=1) +label.pack() +output.pack() +output.focus() +output.bind('<KeyPress>', output.printkey) +root.mainloop() + |