Browse Source

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js into master

David Catuhe 4 years ago
parent
commit
a2a17a4349
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/DeviceInput/deviceInputSystem.ts

+ 5 - 0
src/DeviceInput/deviceInputSystem.ts

@@ -282,6 +282,11 @@ export class DeviceInputSystem implements IDisposable {
         });
 
         this._keyboardUpEvent = ((evt) => {
+            if (!this._keyboardActive) {
+                this._keyboardActive = true;
+                this._registerDevice(DeviceType.Keyboard, 0, DeviceInputSystem._MAX_KEYCODES);
+            }
+
             const kbKey = this._inputs[DeviceType.Keyboard][0];
             if (kbKey) {
                 kbKey[evt.keyCode] = 0;