Lightningbeam/PyGUI-2.5.3/Tests/38-keys.py

23 lines
452 B
Python

#
# Python GUI - Test keys
#
from GUI import Window, run
from testing import say
class TestWindow(Window):
def key_down(self, event):
say("char = %r key = %r unichars = %r _keycode = 0x%04x" % (
event.char, event.key, event.unichars, event._keycode))
instructions = """
Check that the correct 'char' and 'key' values are produced
for all keys.
"""
say(instructions)
win = TestWindow(title = "Test Keys")
win.show()
run()