Constructor

new Keyboard(game)

Be aware that many keyboards are unable to process certain combinations of keys due to hardware
limitations known as ghosting. Full details here: http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/

Returns

addKeyCapture(keycode)

By default when a key is pressed Phaser will not stop the event from propagating up to the browser.
There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll.
You can use addKeyCapture to consume the keyboard event for specific keys so it doesn't bubble up to the the browser.
Pass in either a single keycode or an array/hash of keycodes.

Parameters

Name

Type

Description

keycode

number
|
array
|
object

Either a single numeric keycode or an array/hash of keycodes: [65, 67, 68].