Keyboard events stopped working

Hi, I have a code that worked well a week ago. Now I have the same code - without modification, the event invocation does not work after pressing the keys, I pressed e.g. “j” and/but nothing executed. How can I solve my problem? Error message was not displayed.

if (evt.sourceEvent.key == “j”) {
// code will not be executed
}

JS debugger is your friend. Use DevTools / Source tab, put a breakpoint on the if line, see if event is called on key press, inspect evt.

Some changes were made to the way we process device input. Would you be able to reproduce the code that is no longer working in the playground? We want to understand what changed

I analyzed the problem. The problem is that although I send the lowercase “j” for evaluation. This is interpreted as a capital letter - J. The result, of course, is that the code is not executed. With modification, the code is working well again. Of course, it would be good if it was possible to distinguish the case. Thank you for your help.

Thanks! It seems to be reproducible. We will check and fix that.

1 Like

There is an active PR with a fix that should address the key issue:
Add support for event.key values and handle blur events to DeviceInputSystem by PolygonalSun · Pull Request #9816 · BabylonJS/Babylon.js (github.com)