Implement controls for new UI state

This commit is contained in:
Joscha 2025-02-12 01:05:38 +01:00
parent 2f9b1925dc
commit 6e96ae7fd4
5 changed files with 113 additions and 22 deletions

View file

@ -9,7 +9,12 @@ const ui = useUiStore();
window.addEventListener("keypress", (ev) => {
if (document.activeElement !== document.body) return;
if (ev.key === "Escape" && ui.mode === "focus") {
if (ev.key === "Escape") {
if (ui.mode !== "focus") {
ui.focus();
return;
}
const parent = ui.focusPath.parent();
if (parent) ui.focusOn(parent);
return;