Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: InputSequence

[18:7] extends: FxObj

Wraps FXGL's InputSequence (com.almasb.fxgl.input.InputSequence), a Konami-code-style key-sequence detector. Construct with at least two KeyCode names; matches returns true when the recent suffix of the supplied key queue equals the configured sequence. Typical use: keep a queue of recently-pressed KeyCodes and pass it to matches(queue) on every key event to detect cheat codes or combos.

Methods

  • InputSequence (list KeyNames)

    Creates a new InputSequence from a list of KeyCode names. The list must contain at least two entries.

    • @p KeyNames is a list of KeyCode enum names.
  • adopt (object Ajo)

    Wraps an existing InputSequence AussomJavaObject.

    • @p Ajo is an AussomJavaObject around an InputSequence.
    • @r A new wrapper.
  • getLastKey ()

    Returns the last KeyCode in the sequence (commonly used to gate "only check on this key press").

    • @r An AussomJavaObject around a KeyCode.
  • matches (object QueueObj)

    Returns true when the trailing suffix of the supplied Queue of KeyCodes equals this sequence.

    • @p QueueObj is an AussomJavaObject around a java.util.Queue.
    • @r A bool.