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

Function matchFound

web/pgadmin/static/js/custom_hooks.js:187–196  ·  view source on GitHub ↗
(shortcut, e)

Source from the content-addressed store, hash-verified

185 const shortcutsRef = useRef(shortcuts);
186
187 const matchFound = (shortcut, e)=>{
188 if(!shortcut) return false;
189 let keyCode = getCode(e);
190 const ctrlKey = (isMac() && shortcut.ctrl_is_meta) ? e.metaKey : e.ctrlKey;
191
192 return Boolean(shortcut.alt) == e.altKey &&
193 Boolean(shortcut.shift) == e.shiftKey &&
194 Boolean(shortcut.control) == ctrlKey &&
195 shortcut.key.key_code == keyCode;
196 };
197
198 useEffect(()=>{
199 let ele = eleRef.current ?? document;

Callers 1

dispatchFunction · 0.85

Calls 1

isMacFunction · 0.90

Tested by

no test coverage detected