MCPcopy Create free account
hub / github.com/dailydotdev/apps / onKeyDown

Function onKeyDown

packages/shared/src/hooks/useFeedbackShortcut.ts:31–54  ·  view source on GitHub ↗
(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

29 }
30
31 const onKeyDown = (event: KeyboardEvent) => {
32 if (event.defaultPrevented || isSpotlightShortcutDisabled()) {
33 return;
34 }
35
36 if (!isSpecialKeyPressed({ event }) || !event.shiftKey) {
37 return;
38 }
39
40 if (event.key.toLowerCase() !== 'f') {
41 return;
42 }
43
44 if (isInExtensionIframe(document.activeElement)) {
45 return;
46 }
47
48 event.preventDefault();
49 logEvent({
50 event_name: LogEvent.KeyboardShortcutTriggered,
51 target_id: TargetId.FeedbackOpen,
52 });
53 openModal({ type: LazyModal.Feedback });
54 };
55
56 window.addEventListener('keydown', onKeyDown);
57

Callers

nothing calls this directly

Calls 5

isSpecialKeyPressedFunction · 0.90
isInExtensionIframeFunction · 0.90
logEventFunction · 0.85
openModalFunction · 0.85

Tested by

no test coverage detected