A precise input manager that: - Records the exact timestamp of when a key was pressed or released - Only records key presses for keys bound to game inputs (up/down/left/right)

Static variables

Static methods

staticgetButtonsForDirection(controls:Controls, noteDirection:NoteDirection):Array<FlxGamepadInputID>

@:access(lime._internal.backend.native.NativeCFFI)staticgetCurrentTimestamp():Int64

Returns a precise timestamp, measured in nanoseconds. Timestamp is only useful for comparing against other timestamps.

Returns:

Int64

staticgetKeysForDirection(controls:Controls, noteDirection:NoteDirection):Array<FlxKey>

Constructor

new()

Variables

Methods

getTimeSincePressed(noteDirection:NoteDirection):Int64

Get the time, in nanoseconds, since the given note direction was last pressed.

Parameters:

noteDirection

The note direction to check.

Returns:

An Int64 representing the time since the given note direction was last pressed.

getTimeSinceReleased(noteDirection:NoteDirection):Int64

Get the time, in nanoseconds, since the given note direction was last released.

Parameters:

noteDirection

The note direction to check.

Returns:

An Int64 representing the time since the given note direction was last released.

initializeButtons(controls:Controls, gamepad:FlxGamepad):Void

initializeKeys(controls:Controls):Void

Call this whenever the user's inputs change.

Inherited Variables

Defined by FlxKeyManager

@:value(true)enabled:Bool = true

Whether or not keyboard input is currently enabled.

read onlyjustPressed:KeyList

Helper class to check if a key was just pressed.

read onlyjustReleased:KeyList

Helper class to check if a key was just released.

read onlypressed:KeyList

Helper class to check if a key is pressed.

@:value([])preventDefaultKeys:Array<Key> = []

List of keys on which preventDefault() is called, useful on HTML5 to stop the browser from scrolling when pressing the up or down key for example, or on android to prevent the default back key action.

read onlyreleased:KeyList

Helper class to check if a key is released.

Available since

4.8.0

.

Inherited Methods

Defined by FlxKeyManager

inlineanyJustPressed(KeyArray:Array<Key>):Bool

Check to see if at least one key from an array of keys was just pressed.

Parameters:

KeyArray

An array of key names

Returns:

Whether at least one of the keys passed was just pressed.

inlineanyJustReleased(KeyArray:Array<Key>):Bool

Check to see if at least one key from an array of keys was just released.

Parameters:

KeyArray

An array of key names

Returns:

Whether at least one of the keys passed was just released.

inlineanyPressed(KeyArray:Array<Key>):Bool

Check to see if at least one key from an array of keys is pressed.

Parameters:

KeyArray

An array of key names

Returns:

Whether at least one of the keys passed in is pressed.

checkStatus(KeyCode:Key, Status:FlxInputState):Bool

Check the status of a single of key

Parameters:

KeyCode

KeyCode to be checked.

Status

The key state to check for.

Returns:

Whether the provided key has the specified status.

firstJustPressed():Int

Get the ID of the first key which has just been pressed.

Returns:

The ID of the key or -1 if none were just pressed.

firstJustReleased():Int

Get the ID of the first key which has just been released.

Returns:

The ID of the key or -1 if none were just released.

firstPressed():Int

Get the ID of the first key which is currently pressed.

Returns:

The ID of the first pressed key or -1 if none are pressed.

getIsDown():Array<FlxInput<Key>>

Get an Array of Key that are in a pressed state

Returns:

Array of keys that are currently pressed.

reset():Void

Resets all the keys.