'Display an event for debugging.'

def __repr__(self):

    if (self.type in ['KeyPress', 'KeyRelease']):
        s = ("%s    char='%s'%d    keysym='%s'    keycode=%d:%x    state=%x    keyinfo=%s" % (self.type, self.char, 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
