RepeatThrottle

Throttles repeat-while-held directional input to one action per WIDGET_REPEAT_DELAY_MS, while letting a single tap's press+synthesized- held pair act exactly once. Shared by Slider/Select.handleInput() and BGE.UI.FocusManager's list/pointer navigation - anywhere directional input should act at most once per tap, then repeat while held.

Properties

  • lastActionMs (float) — heldTimeMs of the last held event acted on, or -1 when no hold is in ' progress.

Constructor

new RepeatThrottle(): RepeatThrottle

Instance Methods

shouldAct(input: BGE.GameInput): boolean

Should this input event act now? Only call for input already known to be relevant (e.g. filtered to the right button/direction) - a press always acts; a held event acts only once WIDGET_REPEAT_DELAY_MS has passed since the last action, so the same frame's synthesized held event (heldTimeMs ~0) right after a press doesn't double-act.

Parameters

Returns

  • boolean