(keybind)
| 16 | : /Mac/i.test(navigator.userAgent); |
| 17 | |
| 18 | const parseKeybind = (keybind) => { |
| 19 | if (!keybind) return null; |
| 20 | |
| 21 | const parts = keybind.toLowerCase().split("+"); |
| 22 | return { |
| 23 | ctrl: parts.includes("ctrl"), |
| 24 | shift: parts.includes("shift"), |
| 25 | alt: parts.includes("alt"), |
| 26 | meta: parts.includes("meta"), |
| 27 | key: parts[parts.length - 1], |
| 28 | original: keybind |
| 29 | }; |
| 30 | }; |
| 31 | |
| 32 | export const matchesKeybind = (event, parsedKeybind) => { |
| 33 | if (!parsedKeybind) return false; |