From fdab2627c39de8a4fc37b423096236bf920e031b Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Fri, 12 Jan 2018 17:37:47 +0100 Subject: [PATCH] Calling Application.Draw() for global key handlers which steal the event. --- application.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application.go b/application.go index 3b66e00..667d9df 100644 --- a/application.go +++ b/application.go @@ -46,7 +46,7 @@ func NewApplication() *Application { // The handler receives the Primitive to which the key is originally redirected, // the one which has focus, or nil if it was not directed to a Primitive. The // handler also returns whether or not the key event is then forwarded to that -// Primitive. +// Primitive. Draw() is called implicitly if the event is not forwarded. // // Special keys (e.g. Escape, Enter, or Ctrl-A) are defined by the "key" // argument. The "ch" rune is ignored. Other keys (e.g. "a", "h", or "5") are @@ -134,6 +134,7 @@ func (a *Application) Run() error { if event.Key() == tcell.KeyRune { if handler, ok := a.runeOverrides[event.Rune()]; ok { if !handler(p) { + a.Draw() break } } @@ -144,6 +145,7 @@ func (a *Application) Run() error { pr = nil } if !handler(pr) { + a.Draw() break } }