Implement controls for new UI state
This commit is contained in:
parent
2f9b1925dc
commit
6e96ae7fd4
5 changed files with 113 additions and 22 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue