more logging

This commit is contained in:
Timo K
2026-04-28 13:49:36 +02:00
parent 6b1b316ce4
commit b5c1b36850

View File

@@ -33,6 +33,9 @@ const mayReceiveKeyEvents = (): boolean => {
const noPrimaryFocus =
nothingInFocus || root.contains(focusElement) || focusOnBody;
logger.warn(
`[mayReceiveKeyEvents] nothingInFocus ${nothingInFocus}, focusOnBody ${focusOnBody}, noPrimaryFocus ${noPrimaryFocus}`,
);
// Only if we do not have a primary focus we allow keyboard shortcut events.
return noPrimaryFocus;
};
@@ -103,6 +106,7 @@ export function useCallViewKeyboardShortcuts(
event.preventDefault();
sendReaction?.(KeyToReactionMap[event.key]);
} else if (event.key === "Escape") {
logger.info("Escape key pressed, triggering onBackButtonPressed");
window.controls.onBackButtonPressed?.();
}
},