PlayStateHardwareInput
| Kind | class |
| Package | play.helpers |
| Full name | play.helpers.PlayStateHardwareInput |
| Source | source/play/helpers/PlayStateHardwareInput.hx |
| Compiled when | #if android |
| Metadata | @:access(play.PlayState) |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
LANE_BINDS | Array<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.
laneForKeyCode
static function laneForKeyCode(keyCode:Int):Int
Only compiled when #if android.
Note lane bound to the hardware key code, or -1.
| Parameter | Type | Default |
|---|---|---|
keyCode | Int | — |
onHardwareKey
static function onHardwareKey(state:PlayState, keyCode:Int, down:Bool):Void
Only compiled when #if android.
Handles AndroidHardwareInput.onKey while gameplay is running.
| Parameter | Type | Default |
|---|---|---|
state | PlayState | — |
keyCode | Int | — |
down | Bool | — |
applyHeld
static function applyHeld(state:PlayState):Void
Only compiled when #if android.
Keeps sustain notes sustained while a bound trigger is held down.
| Parameter | Type | Default |
|---|---|---|
state | PlayState | — |
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.
| Parameter | Type | Default |
|---|---|---|
state | PlayState | — |
covered (optional) | Bool | false |
release
static function release(state:PlayState):Void
Only compiled when #if android.
Called when the gameplay state is destroyed.
| Parameter | Type | Default |
|---|---|---|
state | PlayState | — |
Internals
Private / internal members
| Method |
|---|
static function clearHeld(state:PlayState):Void |