MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / parseKeyEventValue

Function parseKeyEventValue

web/pgadmin/static/js/utils.js:35–46  ·  view source on GitHub ↗
(e, useCode=false)

Source from the content-addressed store, hash-verified

33}
34
35export function parseKeyEventValue(e, useCode=false) {
36 let shortcut = '';
37 if(!e) {
38 return null;
39 }
40 if (e.altKey) { shortcut += 'alt+'; }
41 if (e.shiftKey) { shortcut += 'shift+'; }
42 if (isMac() && e.metaKey) { shortcut += 'meta+'; }
43 else if (e.ctrlKey) { shortcut += 'ctrl+'; }
44 shortcut += useCode? getCode(e) : e.key.toLowerCase();
45 return shortcut;
46}
47
48export function isShortcutValue(obj) {
49 if(!obj) return false;

Callers 3

DebuggerEditorFunction · 0.90
QueryFunction · 0.90
CodeMirrorFunction · 0.90

Calls 1

isMacFunction · 0.90

Tested by

no test coverage detected