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.
The addKeyCapture
method enables consuming keyboard event for specific keys so it doesn't bubble up to the the browser
and cause the default browser behavior.
Pass in either a single keycode or an array/hash of keycodes.
Parameters
Name | Type | Description |
---|---|---|
keycode | integer | Array.<integer> | object | Either a single keycode or an array/hash of keycodes such as |
- Source code: input/Keyboard.js (Line 294)
Please login to continue.