You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After registering a key (a letter for example) with capturing enabled Phaser correctly captures the input events. This leads to not being able to type the letter in an input box outside of phaser. This is correct and expected.
However when removing this key, the capturing continues and therefore it still isn't possible to type the letter somewhere outside of Phaser.
I would expect that removing the last registration of a specific key also ends the capturing.
My current workaround is to trigger removeCapture() manually.
Example Test Code
// Register key with capturing enabled by defaultconstkey=scene.input.keyboard.addKey(keyCode);// Removing the keyscene.input.keyboard.removeKey(key,true);// Afterwards I still can't use it outside of Phaser// Removing the capture manually fixes the issuescene.input.keyboard.removeCapture(key.keyCode);
Additional Information
I would expect that removing the last registration of a specific key also ends the capturing.
I think triggering removeCapture() manually is a workaround because in this case I have to keep track of all Key objects listening to the specific key code.
The text was updated successfully, but these errors were encountered:
Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Version
Description
After registering a key (a letter for example) with capturing enabled Phaser correctly captures the input events. This leads to not being able to type the letter in an input box outside of phaser. This is correct and expected.
However when removing this key, the capturing continues and therefore it still isn't possible to type the letter somewhere outside of Phaser.
I would expect that removing the last registration of a specific key also ends the capturing.
My current workaround is to trigger
removeCapture()
manually.Example Test Code
Additional Information
I would expect that removing the last registration of a specific key also ends the capturing.
I think triggering
removeCapture()
manually is a workaround because in this case I have to keep track of allKey
objects listening to the specific key code.The text was updated successfully, but these errors were encountered: