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

Function parseShortcutValue

web/pgadmin/static/js/utils.js:22–33  ·  view source on GitHub ↗
(obj, useCode=false)

Source from the content-addressed store, hash-verified

20import { getCode } from '@fluentui/keyboard-key';
21
22export function parseShortcutValue(obj, useCode=false) {
23 let shortcut = '';
24 if (!obj){
25 return null;
26 }
27 if (obj.alt) { shortcut += 'alt+'; }
28 if (obj.shift) { shortcut += 'shift+'; }
29 if (isMac() && obj.ctrl_is_meta) { shortcut += 'meta+'; }
30 else if (obj.control) { shortcut += 'ctrl+'; }
31 shortcut += useCode ? obj?.key.key_code : obj?.key.char?.toLowerCase();
32 return shortcut;
33}
34
35export function parseKeyEventValue(e, useCode=false) {
36 let shortcut = '';

Callers 4

DebuggerEditorFunction · 0.90
QueryFunction · 0.90
CodeMirrorFunction · 0.90

Calls 1

isMacFunction · 0.90

Tested by

no test coverage detected