Phaser API Documentation

  Version: 
getDuration()

Description:

Returns the duration, in ms, that the Key has been held down for.

If the key is not currently down it will return zero.

The get the duration the Key was held down for in the previous up-down cycle, use the Key.duration property value instead.

Returns:
Description:

The duration, in ms, that the Key has been held down for if currently down.

Type:
  • number
Since: 3.17.0