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.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)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue