Просмотр исходного кода

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

David Catuhe 4 лет назад
Родитель
Сommit
a2a17a4349
1 измененных файлов с 5 добавлено и 0 удалено
  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;