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
This commit is contained in:
parent
ef63dfd398
commit
5615f69d11
14
gui/main.qml
14
gui/main.qml
|
|
@ -59,10 +59,16 @@ ApplicationWindow {
|
||||||
palette.disabled.light: theme.lightColor
|
palette.disabled.light: theme.lightColor
|
||||||
palette.disabled.shadow: theme.shadowColor
|
palette.disabled.shadow: theme.shadowColor
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
Shortcut {
|
||||||
if (ollie.activeState !== "idle") {
|
sequence: "Escape"
|
||||||
event.accepted = true
|
onActivated: {
|
||||||
ollie.interrupt()
|
console.log("ESC shortcut, activeState:", ollie.activeState)
|
||||||
|
if (ollie.activeState !== "idle") {
|
||||||
|
console.log("ESC: calling interrupt()")
|
||||||
|
ollie.interrupt()
|
||||||
|
} else {
|
||||||
|
console.log("ESC: ignored (idle)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue