class TestInput:

    def key_down(self, event):
        which = self.which_key(event)
        if event.auto:
            print "Auto key:", which
        else:
            print "Key down:", which
    
    def key_up(self, event):
        print "Key up:", self.which_key(event)
    
    def which_key(self, event):
        return repr(event.key or event.char)
    
    def mouse_down(self, event):
        print "Mouse down:", event.position, event.num_clicks
        for event in self.track_mouse():
            if event.kind == 'mouse_drag':
                print "Mouse drag:", event.position
            elif event.kind == 'mouse_up':
                print "Mouse up:", event.position
            else:
                print "Unknown event kind:", event.kind

