Interface ComponentKeyListener

    • Method Detail

      • keyTyped

        default boolean keyTyped​(Component component,
                                 char character)
        Called when a key has been typed.
        Parameters:
        component - Component that has the focus, that is receiving this key.
        character - The decoded character that was typed.
        Returns:
        true to consume the event; false to allow it to propagate.
      • keyPressed

        default boolean keyPressed​(Component component,
                                   int keyCode,
                                   Keyboard.KeyLocation keyLocation)
        Called when a key has been pressed.
        Parameters:
        component - Component that has the focus.
        keyCode - The key code for the key that was pressed.
        keyLocation - Location value for the key (left or right for shift keys, etc.).
        Returns:
        true to consume the event; false to allow it to propagate.
      • keyReleased

        default boolean keyReleased​(Component component,
                                    int keyCode,
                                    Keyboard.KeyLocation keyLocation)
        Called when a key has been released.
        Parameters:
        component - Component that has the focus, that is receiving this key event.
        keyCode - Code for the key that was released.
        keyLocation - Location of the key.
        Returns:
        true to consume the event; false to allow it to propagate.