Interface UIKeyListener

All Superinterfaces:
EventListener, KeyListener
All Known Implementing Classes:
AbstractLabyrinthPanel, LabyrinthPanel

public interface UIKeyListener extends KeyListener
An interface for handling key events in a user interface (UI). This interface extends KeyListener and provides default implementations for the keyTyped(KeyEvent) and keyReleased(KeyEvent) methods, allowing implementers to focus on the KeyListener.keyPressed(KeyEvent) method.

Implementers of this interface only need to override the KeyListener.keyPressed(KeyEvent) method to handle key press events, as the other methods are provided with default no-op behavior.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Invoked when a key has been released.
    default void
    Invoked when a key has been typed.

    Methods inherited from interface java.awt.event.KeyListener

    keyPressed
  • Method Details

    • keyTyped

      default void keyTyped(KeyEvent e)
      Invoked when a key has been typed. This method is empty by default, meaning no action is performed. Implementers can override this method if they want to handle key typed events.
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - the KeyEvent containing details about the key event (such as the key code and the key character)
    • keyReleased

      default void keyReleased(KeyEvent e)
      Invoked when a key has been released. This method is empty by default, meaning no action is performed. Implementers can override this method if they want to handle key released events.
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - the KeyEvent containing details about the key event (such as the key code and the key state)