Key#keyCode

keyCode : number The keycode of this key. Source code: input/Key.js (Line 93)

Key#Key

new Key(game, keycode) If you need more fine-grained control over the handling of specific keys you can create and use Phaser.Key objects. Parameters Name Type Description game Phaser.Game Current game instance. keycode integer The key code this Key is responsible for. See Phaser.KeyCode. Source code: input/Key.js (Line 15)

Key#isUp

isUp : boolean The "up" state of the key. This will remain true for as long as the keyboard thinks this key is up. Default Value true Source code: input/Key.js (Line 45)

Key#isDown

isDown : boolean The "down" state of the key. This will remain true for as long as the keyboard thinks this key is held down. Source code: input/Key.js (Line 39)

Key#game

game : Phaser.Game A reference to the currently running game. Source code: input/Key.js (Line 20)

Key#event

[readonly] event : Object Stores the most recent DOM event. Source code: input/Key.js (Line 33)

Key#duration

duration : number If the key is down this value holds the duration of that key press and is constantly updated.If the key is up it holds the duration of the previous down session. The number of milliseconds this key has been held down for. Source code: input/Key.js (Line 76)

Key#downDuration()

downDuration(duration) → {boolean} Returns true if the Key was pressed down within the duration value given, or false if it either isn't down,or was pressed down longer ago than then given duration. Parameters Name Type Argument Default Description duration number <optional> 50 The duration within which the key is considered as being just pressed. Given in ms. Returns boolean - True if the key was pressed down within the given duration. Source code: input/Key.js (Line 253)

Key#ctrlKey

ctrlKey : boolean The down state of the CTRL key, if pressed at the same time as this key. Source code: input/Key.js (Line 57)

Key#altKey

altKey : boolean The down state of the ALT key, if pressed at the same time as this key. Source code: input/Key.js (Line 51)