From 0af1f0fde666430cd92fc95ca15597349ee42948 Mon Sep 17 00:00:00 2001 From: milarin Date: Mon, 24 Apr 2023 14:15:33 +0200 Subject: [PATCH] cascade events to root view in CloseOnKeyPressed --- utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.go b/utils.go index 5e3a4cd..f7becb3 100644 --- a/utils.go +++ b/utils.go @@ -129,6 +129,11 @@ func CloseOnKeyPressed(screen *Screen, key tcell.Key) func(event *KeyEvent) (con screen.Stop() return true } + + if screen.Root != nil { + return screen.Root.OnKeyPressed(event) + } + return false } }