Skip to content

Commit

Permalink
Add iPhone to use CMD key check
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jul 20, 2022
1 parent ce21573 commit f2a6e56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions war/src/main/js/keyboard-shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ window.addEventListener("load", () => {
* @param {string} keyboardShortcut The shortcut for translation
*/
function translateKeyboardShortcutForOS(keyboardShortcut) {
const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0
return keyboardShortcut.replace("CMD", isMac ? "CMD" : "CTRL")
const useCmdKey = navigator.platform.toUpperCase().indexOf("MAC") >= 0 ||
navigator.platform.toUpperCase() === "IPHONE"
return keyboardShortcut.replace("CMD", useCmdKey ? "CMD" : "CTRL")
}

0 comments on commit f2a6e56

Please sign in to comment.