Phaser API Documentation

  Version: 
<static> JustDown(key)

Description:

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 true if the Key is down, otherwise false.

You can only call justDown once per key press. It will only return true once, 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
key Phaser.Input.Keyboard.Key

The Key to check to see if it's just down or not.

Returns:
Description:

true if the Key was just pressed, otherwise false.

Type:
  • boolean
Since: 3.0.0