diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 8b7aa55..9eb8790 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -819,7 +819,7 @@ each binding context: This can be set to a keystroke which will bring up the command input in this context. - Default: + Default: ':' In addition to letters, special keys may be specified in . The following special keys are supported: diff --git a/widgets/aerc.go b/widgets/aerc.go index 7209b2d..bdd18dd 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -339,7 +339,7 @@ func (aerc *Aerc) Event(event tcell.Event) bool { // Keybindings still use : even if you change the ex key exKey = aerc.conf.Bindings.Global.ExKey } - if event.Key() == exKey.Key && event.Rune() == exKey.Rune { + if aerc.isExKey(event, exKey) { aerc.BeginExCommand("") return true } @@ -850,3 +850,11 @@ func errorScreen(s string, conf config.UIConfig) ui.Drawable { grid.AddChild(ui.NewFill(' ', tcell.StyleDefault)).At(2, 0) return grid } + +func (aerc *Aerc) isExKey(event *tcell.EventKey, exKey config.KeyStroke) bool { + if event.Key() == tcell.KeyRune { + // Compare runes if it's a KeyRune + return event.Modifiers() == exKey.Modifiers && event.Rune() == exKey.Rune + } + return event.Modifiers() == exKey.Modifiers && event.Key() == exKey.Key +}