Interface KeyboardInputHandler

All Known Implementing Classes:
GuiComponent, TextEditComponent, WorldNavigationUserInputTracker

public interface KeyboardInputHandler
This is the process:

1. Component receives focus, perhaps because user clicked on it with the mouse. 2. Now component will receive user key press and release events from the keyboard. 3. Component loses focus. Perhaps user chose another component to interact with.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    focusLost(ViewPanel viewPanel)
    Called when the component loses keyboard focus.
    boolean
    Called when the component receives keyboard focus.
    boolean
    keyPressed(KeyEvent event, ViewPanel viewPanel)
    Called when a key is pressed while the component has focus.
    boolean
    keyReleased(KeyEvent event, ViewPanel viewPanel)
    Called when a key is released while the component has focus.
  • Method Details

    • focusLost

      boolean focusLost(ViewPanel viewPanel)
      Called when the component loses keyboard focus.
      Parameters:
      viewPanel - the view panel that owns this handler
      Returns:
      true if view needs to be re-rendered
    • focusReceived

      boolean focusReceived(ViewPanel viewPanel)
      Called when the component receives keyboard focus.
      Parameters:
      viewPanel - the view panel that owns this handler
      Returns:
      true if view needs to be re-rendered
    • keyPressed

      boolean keyPressed(KeyEvent event, ViewPanel viewPanel)
      Called when a key is pressed while the component has focus.
      Parameters:
      event - the key event
      viewPanel - the view panel that owns this handler
      Returns:
      true if view needs to be re-rendered
    • keyReleased

      boolean keyReleased(KeyEvent event, ViewPanel viewPanel)
      Called when a key is released while the component has focus.
      Parameters:
      event - the key event
      viewPanel - the view panel that owns this handler
      Returns:
      true if view needs to be re-rendered