|
4 | 4 |
|
5 | 5 | let { keybindDialog = $bindable() } = $props(); |
6 | 6 |
|
| 7 | + let modifierKey = |
| 8 | + navigator.platform.startsWith("Mac") || |
| 9 | + navigator.platform.includes("iPhone") |
| 10 | + ? "⌘" |
| 11 | + : "Ctrl"; |
| 12 | +
|
7 | 13 | const keysAndActions = [ |
8 | | - { keys: ["Ctrl", "B"], action: "Bold" }, |
9 | | - { keys: ["Ctrl", "I"], action: "Italic" }, |
10 | | - { keys: ["Ctrl", "U"], action: "Underline" }, |
11 | | - { keys: ["Ctrl", "Shift", "S"], action: "Strikethrough" }, |
12 | | - { keys: ["Ctrl", "O"], action: "Obfuscate" }, |
13 | | - { keys: ["Ctrl", "Z"], action: "Undo" }, |
14 | | - { keys: ["Ctrl", "Y"], action: "Redo" }, |
15 | | - { keys: ["Ctrl", "Shift", "X"], action: "Clear all formatting" }, |
| 14 | + { keys: [modifierKey, "B"], action: "Bold" }, |
| 15 | + { keys: [modifierKey, "I"], action: "Italic" }, |
| 16 | + { keys: [modifierKey, "U"], action: "Underline" }, |
| 17 | + { keys: [modifierKey, "Shift", "S"], action: "Strikethrough" }, |
| 18 | + { keys: [modifierKey, "O"], action: "Obfuscate" }, |
| 19 | + { keys: [modifierKey, "Z"], action: "Undo" }, |
| 20 | + { keys: [modifierKey, "Y"], action: "Redo" }, |
| 21 | + { keys: [modifierKey, "Shift", "X"], action: "Clear all formatting" }, |
16 | 22 | ]; |
17 | 23 | const modalKeybinds = [ |
18 | | - { keys: ["Ctrl", "Shift", "G"], action: "Add Color Gradient" }, |
19 | | - { keys: ["Ctrl", "Shift", "K"], action: "View Keybinds" }, |
20 | | - { keys: ["Ctrl", "Shift", "T"], action: "Add Click Event" }, |
21 | | - { keys: ["Ctrl", "Shift", "H"], action: "Add Hover Event" }, |
22 | | - { keys: ["Ctrl", "Shift", "C"], action: "Add Custom Color" }, |
23 | | - { keys: ["Ctrl", "Shift", "F"], action: "Add a font" }, |
24 | | - { keys: ["Ctrl", "Shift", "W"], action: "Add Custom Source" }, |
25 | | - { keys: ["Ctrl", "Shift", "U"], action: "Unicode Menu" }, |
26 | | - { keys: ["Ctrl", "Shift", "I"], action: "Import Menu" }, |
27 | | - { keys: ["Ctrl", "Shift", "E"], action: "Export Menu" }, |
28 | | - { keys: ["Ctrl", "Shift", "L"], action: "Load a snapshot" }, |
| 24 | + { keys: [modifierKey, "Shift", "G"], action: "Add Color Gradient" }, |
| 25 | + { keys: [modifierKey, "Shift", "K"], action: "View Keybinds" }, |
| 26 | + { keys: [modifierKey, "Shift", "T"], action: "Add Click Event" }, |
| 27 | + { keys: [modifierKey, "Shift", "H"], action: "Add Hover Event" }, |
| 28 | + { keys: [modifierKey, "Shift", "C"], action: "Add Custom Color" }, |
| 29 | + { keys: [modifierKey, "Shift", "F"], action: "Add a font" }, |
| 30 | + { keys: [modifierKey, "Shift", "W"], action: "Add Custom Source" }, |
| 31 | + { keys: [modifierKey, "Shift", "U"], action: "Unicode Menu" }, |
| 32 | + { keys: [modifierKey, "Shift", "I"], action: "Import Menu" }, |
| 33 | + { keys: [modifierKey, "Shift", "E"], action: "Export Menu" }, |
| 34 | + { keys: [modifierKey, "Shift", "L"], action: "Load a snapshot" }, |
29 | 35 | ]; |
30 | 36 | </script> |
31 | 37 |
|
|
0 commit comments