src/main/java/com/spinyowl/legui/component/misc/listener/textinput/TextInputKeyEventListener.java
@Override
  public void process(KeyboardEvent event) {
    TextInput gui = (TextInput) event.getTargetComponent();
    boolean pressed = event.getAction() != KeyAction.RELEASE;
    if (!pressed) {
      return;
    }

    String oldText = gui.getTextState().getText();
    processKeys(event, gui);
    String newText = gui.getTextState().getText();
    if (!oldText.equals(newText)) {
      EventProcessorProvider.getInstance().pushEvent(
          new TextInputContentChangeEvent<>(gui, event.getContext(), event.getFrame(), oldText,
              newText));
    }
  }
/**
   * Used to handle {@link KeyEvent}.
   *
   * @param event event to handle.
   */
Used to handle  KeyEvent.
@param event event to handle.
Used to handle KeyEvent . @param event event to handle .
@Override
  public void process(KeyboardEvent event) {
    TextInput gui = (TextInput) event.getTargetComponent();
    boolean pressed = event.getAction() != KeyAction.RELEASE;
    if (!pressed) {
      return;
    }
    String oldText = gui.getTextState().getText();
    processKeys(event, gui);
    String newText = gui.getTextState().getText();
    if (!oldText.equals(newText)) {
      EventProcessorProvider.getInstance().pushEvent(
          new TextInputContentChangeEvent<>(gui, event.getContext(), event.getFrame(), oldText,
              newText));
    }
  }
@ Override public void process ( KeyboardEvent event ) { TextInput gui = ( TextInput ) event . getTargetComponent ( ) ; boolean pressed = event . getAction ( ) != KeyAction . RELEASE ; if ( ! pressed ) { return ; } String oldText = gui . getTextState ( ) . getText ( ) ; processKeys ( event , gui ) ; String newText = gui . getTextState ( ) . getText ( ) ; if ( ! oldText . equals ( newText ) ) { EventProcessorProvider . getInstance ( ) . pushEvent ( new TextInputContentChangeEvent < > ( gui , event . getContext ( ) , event . getFrame ( ) , oldText , newText ) ) ; } }
Used to handle {@link KeyEvent}.
Used to handle { @link KeyEvent } .