Skip to content
Eloy Villasclaras edited this page Apr 13, 2016 · 1 revision

<key> adds a key to the game keyboard input. It must be a child of <input>.

Properties

Property Notes
keyCode Phaser key code, e.g. Phaser.KeyCode.P
keyName Name given to the key object for callbacks (see cursor key names)
onDown Callback for the onDown event. Receives two parameters:
  1. key: the key object that caused the event
  2. context: shared context for react-phaser callbacks
onUp Callback for the onUp event. Receives two parameters:
  1. key: the key object
  2. context: shared context
onHoldCallback Callback for the onHold event. Receives two parameters:
  1. key: the key object
  2. context: shared context
Clone this wiki locally