MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / waveKeyToElectronKey

Function waveKeyToElectronKey

emain/emain-util.ts:267–352  ·  view source on GitHub ↗
(waveKey: string)

Source from the content-addressed store, hash-verified

265}
266
267export function waveKeyToElectronKey(waveKey: string): string {
268 const waveParts = waveKey.split(":");
269 const electronParts: Array<string> = waveParts.map((part: string) => {
270 const digitRegexpMatch = new RegExp("^c{Digit([0-9])}$").exec(part);
271 const numpadRegexpMatch = new RegExp("^c{Numpad([0-9])}$").exec(part);
272 const lowercaseCharMatch = new RegExp("^([a-z])$").exec(part);
273 if (part == "ArrowUp") {
274 return "Up";
275 }
276 if (part == "ArrowDown") {
277 return "Down";
278 }
279 if (part == "ArrowLeft") {
280 return "Left";
281 }
282 if (part == "ArrowRight") {
283 return "Right";
284 }
285 if (part == "Soft1") {
286 return "F21";
287 }
288 if (part == "Soft2") {
289 return "F22";
290 }
291 if (part == "Soft3") {
292 return "F23";
293 }
294 if (part == "Soft4") {
295 return "F24";
296 }
297 if (part == " ") {
298 return "Space";
299 }
300 if (part == "CapsLock") {
301 return "Capslock";
302 }
303 if (part == "NumLock") {
304 return "Numlock";
305 }
306 if (part == "ScrollLock") {
307 return "Scrolllock";
308 }
309 if (part == "AudioVolumeUp") {
310 return "VolumeUp";
311 }
312 if (part == "AudioVolumeDown") {
313 return "VolumeDown";
314 }
315 if (part == "AudioVolumeMute") {
316 return "VolumeMute";
317 }
318 if (part == "MediaTrackNext") {
319 return "MediaNextTrack";
320 }
321 if (part == "MediaTrackPrevious") {
322 return "MediaPreviousTrack";
323 }
324 if (part == "Decimal") {

Callers 1

registerGlobalHotkeyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected