I am done

This commit is contained in:
2024-10-30 22:14:35 +01:00
parent 720dc28c09
commit 40e2a747cf
36901 changed files with 5011519 additions and 0 deletions

View File

@ -0,0 +1,37 @@
class Event(object):
"""Represent events from the console."""
def __init__(self, console, input):
pass
def __repr__(self):
"""Display an event for debugging."""
if self.type in ["KeyPress", "KeyRelease"]:
chr = self.char
if ord(chr) < ord("A"):
chr = "?"
s = "%s char='%s'%d keysym='%s' keycode=%d:%x state=%x keyinfo=%s" % (
self.type,
chr,
ord(self.char),
self.keysym,
self.keycode,
self.keycode,
self.state,
self.keyinfo,
)
elif self.type in ["Motion", "Button"]:
s = "%s x=%d y=%d state=%x" % (self.type, self.x, self.y, self.state)
elif self.type == "Configure":
s = "%s w=%d h=%d" % (self.type, self.width, self.height)
elif self.type in ["FocusIn", "FocusOut"]:
s = self.type
elif self.type == "Menu":
s = "%s state=%x" % (self.type, self.state)
else:
s = "unknown event type"
return s
# def __str__(self):
# return "('%s',%s,%s,%s)"%(self.char,self.key,self.state,self.keyinfo)