diff options
author | 2021-08-15 20:27:45 +0530 | |
---|---|---|
committer | 2021-08-15 15:13:35 +0000 | |
commit | 59e503fdc61802bd9f9fac2c030c2192bd95c4ce (patch) | |
tree | b19096beb9125baf9a3ed14e3197908a190eb308 /src/environment.js | |
parent | Downgraded 'sqlite3' back to '5.0.0' since it doesn't compile on macos (in de... (diff) | |
download | ferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.tar.gz ferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.tar.zst ferdium-app-59e503fdc61802bd9f9fac2c030c2192bd95c4ce.zip |
fix: Fix issue with shortcut accelerators not working on macos where symbols were used for shift/alt keys
Diffstat (limited to 'src/environment.js')
-rw-r--r-- | src/environment.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/environment.js b/src/environment.js index f2a889be4..f8a51b207 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -79,17 +79,17 @@ export const is64Bit = osArch.match(/64/); | |||
79 | const ctrlKey = isMac ? '⌘' : 'Ctrl'; | 79 | const ctrlKey = isMac ? '⌘' : 'Ctrl'; |
80 | const cmdKey = isMac ? 'Cmd' : 'Ctrl'; | 80 | const cmdKey = isMac ? 'Cmd' : 'Ctrl'; |
81 | 81 | ||
82 | export const altKey = isMac ? '⌥' : 'Alt'; | 82 | export const altKey = (isAccelerator = true) => (!isAccelerator && isMac ? '⌥' : 'Alt'); |
83 | export const shiftKey = isMac ? '⇧' : 'Shift'; | 83 | export const shiftKey = (isAccelerator = true) => (!isAccelerator && isMac ? '⇧' : 'Shift'); |
84 | 84 | ||
85 | // Platform specific shortcut keys | 85 | // Platform specific shortcut keys |
86 | export const shortcutKey = (isAccelerator = true) => (isAccelerator ? cmdKey : ctrlKey); | 86 | export const cmdOrCtrlShortcutKey = (isAccelerator = true) => (isAccelerator ? cmdKey : ctrlKey); |
87 | export const lockFerdiShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+${shiftKey}+L`; | 87 | export const lockFerdiShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+${shiftKey(isAccelerator)}+L`; |
88 | export const todosToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+T`; | 88 | export const todosToggleShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+T`; |
89 | export const workspaceToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+D`; | 89 | export const workspaceToggleShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+D`; |
90 | export const muteFerdiShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+${shiftKey}+M`; | 90 | export const muteFerdiShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+${shiftKey(isAccelerator)}+M`; |
91 | export const addNewServiceShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+N`; | 91 | export const addNewServiceShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+N`; |
92 | export const settingsShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+${isMac ? ',' : 'P'}`; | 92 | export const settingsShortcutKey = (isAccelerator = true) => `${cmdOrCtrlShortcutKey(isAccelerator)}+${isMac ? ',' : 'P'}`; |
93 | 93 | ||
94 | let api; | 94 | let api; |
95 | let wsApi; | 95 | let wsApi; |