Exemplo n.º 1
0
  public boolean apply(final TwoInputStates states) {
    final InputState currentState = states.getCurrent();
    final InputState previousState = states.getPrevious();

    return currentState
        .getKeyboardState()
        .getKeysReleasedSince(previousState.getKeyboardState())
        .contains(key);
  }
Exemplo n.º 2
0
  @Override
  public boolean apply(final TwoInputStates twoInputStates) {
    final InputState currentState = twoInputStates.getCurrent();
    final InputState previousState = twoInputStates.getPrevious();

    return !currentState
        .getKeyboardState()
        .getKeysPressedSince(previousState.getKeyboardState())
        .isEmpty();
  }