mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-17 16:50:31 +00:00
Add navigator.keyboard null check
Browser can have a null keyboard property, so we need to check for nullability.
This commit is contained in:
parent
d765de14dc
commit
42c088a0d9
1 changed files with 2 additions and 1 deletions
|
|
@ -53,7 +53,8 @@ let keyMap = {};
|
|||
// special mode for changing button bindings in the options
|
||||
let isKeysFilteredMode = true;
|
||||
// if the browser supports Keyboard Lock API (Firefox does not)
|
||||
let hasKeyboardLock = ('keyboard' in navigator) && ('lock' in navigator.keyboard)
|
||||
let hasKeyboardLock = ('keyboard' in navigator)
|
||||
&& navigator.keyboard && ('lock' in navigator.keyboard)
|
||||
|
||||
let locked = false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue