- Source: src/input/keyboard/index.js (Line 7)
Classes
Namespaces
Methods
-
<static> DownDuration(key [, duration])
-
Returns
trueif the Key was pressed down within thedurationvalue given, based on the current game clock time. Orfalseif it either isn't down, or was pressed down longer ago than the given duration.Parameters:
Name Type Argument Default Description keyPhaser.Input.Keyboard.Key The Key object to test.
durationnumber <optional>
50 The duration, in ms, within which the key must have been pressed down.
- Since: 3.0.0
- Source: src/input/keyboard/keys/DownDuration.js (Line 7)
Returns:
trueif the Key was pressed down withindurationms ago, otherwisefalse.- Type
- boolean
-
<static> JustDown(key)
-
The justDown value allows you to test if this Key has just been pressed down or not.
When you check this value it will return
trueif the Key is down, otherwisefalse.You can only call justDown once per key press. It will only return
trueonce, until the Key is released and pressed down again. This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop.Parameters:
Name Type Description keyPhaser.Input.Keyboard.Key The Key to check to see if it's just down or not.
- Since: 3.0.0
- Source: src/input/keyboard/keys/JustDown.js (Line 7)
Returns:
trueif the Key was just pressed, otherwisefalse.- Type
- boolean
-
<static> JustUp(key)
-
The justUp value allows you to test if this Key has just been released or not.
When you check this value it will return
trueif the Key is up, otherwisefalse.You can only call JustUp once per key release. It will only return
trueonce, until the Key is pressed down and released again. This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop.Parameters:
Name Type Description keyPhaser.Input.Keyboard.Key The Key to check to see if it's just up or not.
- Since: 3.0.0
- Source: src/input/keyboard/keys/JustUp.js (Line 7)
Returns:
trueif the Key was just released, otherwisefalse.- Type
- boolean
-
<static> UpDuration(key [, duration])
-
Returns
trueif the Key was released within thedurationvalue given, based on the current game clock time. Or returnsfalseif it either isn't up, or was released longer ago than the given duration.Parameters:
Name Type Argument Default Description keyPhaser.Input.Keyboard.Key The Key object to test.
durationnumber <optional>
50 The duration, in ms, within which the key must have been released.
- Since: 3.0.0
- Source: src/input/keyboard/keys/UpDuration.js (Line 7)
Returns:
trueif the Key was released withindurationms ago, otherwisefalse.- Type
- boolean
