MCPcopy Create free account
hub / github.com/gnmyt/Nexterm / parseKeybind

Function parseKeybind

client/src/common/contexts/KeymapContext.jsx:18–30  ·  view source on GitHub ↗
(keybind)

Source from the content-addressed store, hash-verified

16 : /Mac/i.test(navigator.userAgent);
17
18const 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
32export const matchesKeybind = (event, parsedKeybind) => {
33 if (!parsedKeybind) return false;

Callers 1

loadKeymapsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected