diff options
author | 2021-08-13 00:24:40 +0530 | |
---|---|---|
committer | 2021-08-13 00:24:40 +0530 | |
commit | 52dba987668f4962895e8298d8d32fe877240a76 (patch) | |
tree | 9ccbd1938ab9ee066918252347d7b87bad549529 /src/environment.js | |
parent | Fix error while importing without workspaces (#1776) (diff) | |
download | ferdium-app-52dba987668f4962895e8298d8d32fe877240a76.tar.gz ferdium-app-52dba987668f4962895e8298d8d32fe877240a76.tar.zst ferdium-app-52dba987668f4962895e8298d8d32fe877240a76.zip |
refactor: Use the 'shortcutKey' function without exposing the 'ctrlKey' or the 'cmdKey'
Diffstat (limited to 'src/environment.js')
-rw-r--r-- | src/environment.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/environment.js b/src/environment.js index 39b854db4..42c6b2927 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -75,14 +75,14 @@ export const is64Bit = osArch.match(/64/); | |||
75 | 75 | ||
76 | // for accelerator, show the shortform that electron/OS understands | 76 | // for accelerator, show the shortform that electron/OS understands |
77 | // for tooltip, show symbol | 77 | // for tooltip, show symbol |
78 | export const ctrlKey = isMac ? '⌘' : 'Ctrl'; | 78 | const ctrlKey = isMac ? '⌘' : 'Ctrl'; |
79 | export const cmdKey = isMac ? 'Cmd' : 'Ctrl'; | 79 | const cmdKey = isMac ? 'Cmd' : 'Ctrl'; |
80 | 80 | ||
81 | export const altKey = isMac ? '⌥' : 'Alt'; | 81 | export const altKey = isMac ? '⌥' : 'Alt'; |
82 | export const shiftKey = isMac ? '⇧' : 'Shift'; | 82 | export const shiftKey = isMac ? '⇧' : 'Shift'; |
83 | 83 | ||
84 | // Platform specific shortcut keys | 84 | // Platform specific shortcut keys |
85 | const shortcutKey = (isAccelerator) => `${isAccelerator ? cmdKey : ctrlKey}`; | 85 | export const shortcutKey = (isAccelerator = true) => (isAccelerator ? cmdKey : ctrlKey); |
86 | export const lockFerdiShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+${shiftKey}+L`; | 86 | export const lockFerdiShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+${shiftKey}+L`; |
87 | export const todosToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+T`; | 87 | export const todosToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+T`; |
88 | export const workspaceToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+D`; | 88 | export const workspaceToggleShortcutKey = (isAccelerator = true) => `${shortcutKey(isAccelerator)}+D`; |