def key_event(self, key, action):
        """
        Handle key events in a generic way
        supporting all window types.
        """
        if action == self.wnd.keys.ACTION_PRESS:
            if key == self.wnd.keys.SPACE:
                print("Space was pressed")

        if action == self.wnd.keys.ACTION_RELEASE:
            if key == self.wnd.keys.SPACE:
                print("Space was released")
def key_event ( self , key , action ) : if action == self . wnd . keys . ACTION_PRESS : if key == self . wnd . keys . SPACE : print ( "Space was pressed" ) if action == self . wnd . keys . ACTION_RELEASE : if key == self . wnd . keys . SPACE : print ( "Space was released" )
Handle key events in a generic way
        supporting all window types.