Phaser API Documentation

  Version: 
removeCapture(keycode)

Description:

Removes an existing key capture.

Please note that keyboard captures are global. This means that if you call this method from within a Scene, to remove the capture of a key, then it will remove it for any Scene in your game, not just the calling one.

You can pass a single key code value:

this.input.keyboard.removeCapture(62);

An array of key codes:

this.input.keyboard.removeCapture([ 62, 63, 64 ]);

Or, a comma-delimited string:

this.input.keyboard.removeCapture('W,S,A,D');

To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'.

You can also provide an array mixing both strings and key code integers.

Parameters:

name type description
keycode string | number | Array.<number> | Array.<any>

The Key Codes to disable event capture for.

Returns:
Description:

This KeyboardPlugin object.

Since: 3.16.0