We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 000beb2 commit af141f6Copy full SHA for af141f6
1 file changed
src/input/keyboard/KeyboardPlugin.js
@@ -566,6 +566,38 @@ var KeyboardPlugin = new Class({
566
return this;
567
},
568
569
+ /**
570
+ * Removes all Key objects created by _this_ Keyboard Plugin.
571
+ *
572
+ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeAllKeys
573
+ * @since 3.24.0
574
575
+ * @param {boolean} [destroy=false] - Call `Key.destroy` on each removed Key object?
576
577
+ * @return {this} This KeyboardPlugin object.
578
+ */
579
+ removeAllKeys: function (destroy)
580
+ {
581
+ var keys = this.keys;
582
+
583
+ for (var i = 0; i < keys.length; i++)
584
585
+ var key = keys[i];
586
587
+ if (key)
588
589
+ keys[i] = undefined;
590
591
+ if (destroy)
592
593
+ key.destroy();
594
+ }
595
596
597
598
+ return this;
599
+ },
600
601
/**
602
* Creates a new KeyCombo.
603
*
0 commit comments