Skip to main content

PlayStateHardwareInput

Kindclass
Packageplay.helpers
Full nameplay.helpers.PlayStateHardwareInput
Sourcesource/play/helpers/PlayStateHardwareInput.hx
Compiled when#if android
Metadata@:access(play.PlayState)

Public fields​

NameTypeStaticDefaultNotes
LANE_BINDSArray<String>yes['hw_note_left', 'hw_note_down', 'hw_note_up', 'hw_note_right']final · #if android · Keybind names of the note lanes, in lane order (same order as keysArray).

Public methods​

hasBindings​

static function hasBindings():Bool

Only compiled when #if android.

True when at least one hardware trigger is bound to a note lane.

View source

laneForKeyCode​

static function laneForKeyCode(keyCode:Int):Int

Only compiled when #if android.

Note lane bound to the hardware key code, or -1.

ParameterTypeDefault
keyCodeInt—

View source

onHardwareKey​

static function onHardwareKey(state:PlayState, keyCode:Int, down:Bool):Void

Only compiled when #if android.

Handles AndroidHardwareInput.onKey while gameplay is running.

ParameterTypeDefault
statePlayState—
keyCodeInt—
downBool—

View source

applyHeld​

static function applyHeld(state:PlayState):Void

Only compiled when #if android.

Keeps sustain notes sustained while a bound trigger is held down.

ParameterTypeDefault
statePlayState—

View source

syncVolumeKeys​

static function syncVolumeKeys(state:PlayState, covered:Bool = false):Void

Only compiled when #if android.

Captures volume keys only while gameplay is live; releases them otherwise. @param covered true while a substate is being opened (pause, game over, ...): flixel only assigns subState on the next update, so the caller says so.

ParameterTypeDefault
statePlayState—
covered (optional)Boolfalse

View source

release​

static function release(state:PlayState):Void

Only compiled when #if android.

Called when the gameplay state is destroyed.

ParameterTypeDefault
statePlayState—

View source

Internals​

Private / internal members
Method
static function clearHeld(state:PlayState):Void