Skip to content

Commit a7fba60

Browse files
committed
By default, no key captures.
1 parent 97805af commit a7fba60

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

src/boot/Config.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var GetFastValue = require('../utils/object/GetFastValue');
1111
var GetValue = require('../utils/object/GetValue');
1212
var IsPlainObject = require('../utils/object/IsPlainObject');
1313
var MATH = require('../math/const');
14-
var NumberArray = require('../utils/array/NumberArray');
1514
var RND = require('../math/random-data-generator/RandomDataGenerator');
1615
var NOOP = require('../utils/NOOP');
1716
var DefaultPlugins = require('../plugins/DefaultPlugins');
@@ -65,7 +64,7 @@ var ValueToColor = require('../display/color/ValueToColor');
6564
* @typedef {object} KeyboardInputConfig
6665
*
6766
* @property {*} [target=window] - Where the Keyboard Manager listens for keyboard input events.
68-
* @property {(boolean|integer[])} [capture] - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it's set to all the space key, cursors and all alphanumeric keys. Or, set to 'false' to disable.
67+
* @property {?integer} [capture] - `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty.
6968
*/
7069

7170
/**
@@ -422,21 +421,9 @@ var Config = new Class({
422421
this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window);
423422

424423
/**
425-
* @const {(boolean|integer[])} Phaser.Boot.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it's set to all alphanumeric keys. Or, set to 'false' to disable.
424+
* @const {?integer[]} Phaser.Boot.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty.
426425
*/
427-
var defaultCaptures = [ 32, 38, 39, 40, 42 ];
428-
429-
defaultCaptures = defaultCaptures.concat(NumberArray(48, 57));
430-
defaultCaptures = defaultCaptures.concat(NumberArray(65, 90));
431-
432-
var keyboardCapture = GetValue(config, 'input.keyboard.capture', defaultCaptures);
433-
434-
if (!Array.isArray(keyboardCapture))
435-
{
436-
keyboardCapture = [];
437-
}
438-
439-
this.inputKeyboardCapture = keyboardCapture;
426+
this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []);
440427

441428
/**
442429
* @const {(boolean|object)} Phaser.Boot.Config#inputMouse - Enable the Mouse Plugin. This can be disabled in games that don't need mouse input.

0 commit comments

Comments
 (0)