use of com.almasb.fxgl.input.InputSequence in project FXGL by AlmasB.
the class InputSequenceSample method initInput.
@Override
protected void initInput() {
Input input = FXGL.getInput();
var sequence = new InputSequence(KeyCode.Q, KeyCode.W, KeyCode.E, KeyCode.R);
// the action fires only when the sequence above (Q, W, E, R) is complete
// useful for input combos
input.addAction(new UserAction("Print Line") {
@Override
protected void onActionBegin() {
System.out.println("Action Begin");
}
@Override
protected void onAction() {
System.out.println("On Action");
}
@Override
protected void onActionEnd() {
System.out.println("Action End");
}
}, sequence);
}
Aggregations