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

Function onKeyDown

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

isSpecialKeyPressedFunction · 0.90
isInExtensionIframeFunction · 0.90
logEventFunction · 0.85

Tested by

no test coverage detected