mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Changed option keyboard shortcuts to use command instead
This commit is contained in:
1 parent
32cfb034e2
commit
16c3552be6
9 files changed
+72
-56
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// The platform's command modifier: Cmd on macOS, Ctrl elsewhere. For mouse
|
||||
// gestures it is exactly that key — on macOS, Ctrl+click is a right-click, so
|
||||
// accepting either (as the keyboard shortcuts do) would start a drag under a
|
||||
// context menu.
|
||||
|
||||
export const IS_MAC = /Mac|iPhone|iPad/.test(navigator.userAgent)
|
||||
|
||||
/** Whether the command modifier is held. */
|
||||
export const hasMod = (e: { metaKey: boolean; ctrlKey: boolean }) => (IS_MAC ? e.metaKey : e.ctrlKey)
|
||||
|
||||
/** Its `KeyboardEvent.key`, for following it being pressed mid-gesture. */
|
||||
export const MOD_KEY = IS_MAC ? 'Meta' : 'Control'
|
||||
|
||||
/** Its name in a tooltip ("Cmd-click"). */
|
||||
export const MOD_NAME = IS_MAC ? 'Cmd' : 'Ctrl'
|
||||
Reference in new issue
Block a user