Skip to content

Commit 1a52904

Browse files
committed
Use userAgent for metaKey detection
navigator.platform is deprecated
1 parent adf52f0 commit 1a52904

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ console.log("LiteJS is in debug mode, but it's fine for production")
13991399

14001400
/*** kb ***/
14011401
var kbMaps = []
1402-
, kbMod = LiteJS.kbMod = /^(Mac|iP)/.test(navigator.platform) ? "metaKey" : "ctrlKey"
1402+
, kbMod = LiteJS.kbMod = /\bMac|\biP/.test(navigator.userAgent) ? "metaKey" : "ctrlKey"
14031403
, kbCodes = LiteJS.kbCodes = ",,,,,,,,backspace,tab,,,,enter,,,shift,ctrl,alt,pause,caps,,,,,,,esc,,,,,,pgup,pgdown,end,home,left,up,right,down,,,,,ins,del,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,cmd,,,,,,,,,,,,,,,,,,,,,f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12".split(splitRe)
14041404

14051405
El.addKb = addKb

0 commit comments

Comments
 (0)