From 6d9024789cffec0be7ca224cfaab4f6a773f3388 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Thu, 11 Jul 2024 12:22:49 +0100 Subject: [PATCH] Fix issue when a key name could be unknown Fixes #89 --- input.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input.go b/input.go index 58951aef..225cc3b4 100644 --- a/input.go +++ b/input.go @@ -165,8 +165,8 @@ func (t *Terminal) TypedShortcut(s fyne.Shortcut) { if ds, ok := s.(*desktop.CustomShortcut); ok { t.ShortcutHandler.TypedShortcut(s) // it's not clear how we can check if this consumed the event - // handle CTRL+A to CTRL+_ and everything inbetween - if ds.Modifier == fyne.KeyModifierControl { + // handle CTRL+A to CTRL+_ and everything in-between + if ds.Modifier == fyne.KeyModifierControl && len(ds.KeyName) > 0 { char := ds.KeyName[0] off := char - 'A' + 1 switch {