From 5615f69d114565d5cbda74656acd15010900c2e2 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 1 Aug 2026 12:04:27 +0200 Subject: [PATCH] gui: use Shortcut for ESC key instead of Keys handler - Keys.onEscapePressed doesn't fire when child items have focus - Shortcut element provides proper global key handling - Added console.log debugging to track ESC activation and activeState --- gui/main.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gui/main.qml b/gui/main.qml index da6dbda..b5d1c22 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -59,10 +59,16 @@ ApplicationWindow { palette.disabled.light: theme.lightColor palette.disabled.shadow: theme.shadowColor - Keys.onEscapePressed: { - if (ollie.activeState !== "idle") { - event.accepted = true - ollie.interrupt() + Shortcut { + sequence: "Escape" + onActivated: { + console.log("ESC shortcut, activeState:", ollie.activeState) + if (ollie.activeState !== "idle") { + console.log("ESC: calling interrupt()") + ollie.interrupt() + } else { + console.log("ESC: ignored (idle)") + } } }