Key event callback for glfw.
        Translates and forwards keyboard event to :py:func:`keyboard_event`

        Args:
            window: Window event origin
            key: The key that was pressed or released.
            scancode: The system-specific scancode of the key.
            action: GLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT
            mods: Bit field describing which modifier keys were held down.

def key_event_callback(self, window, key, scancode, action, mods):
        """
        Key event callback for glfw.
        Translates and forwards keyboard event to :py:func:`keyboard_event`

        Args:
            window: Window event origin
            key: The key that was pressed or released.
            scancode: The system-specific scancode of the key.
            action: GLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT
            mods: Bit field describing which modifier keys were held down.
        """
        if key == self.keys.ESCAPE:
            self.close()

        self.example.key_event(key, action)