binds: fix ctrl-i and ctrl-m key definitions

On all terminals, ctrl-i sends a tab character (0x09). For some reason,
tcell.ModCtrl+tcell.KeyCtrlI is interpreted as ctrl-tab.

Similarly, ctrl-m sends a new line (0x0a) and
tcell.ModCtrl+tcell.KeyCtrlM is interpreted as ctrl-enter.

Remove control modifier for these two key definitions only. All others
do not work without them.

Fixes: 7a6c808c04 ("bindings: prepare for more modifers")
Fixes: https://todo.sr.ht/~rjarry/aerc/56
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
This commit is contained in:
Robin Jarry 2022-07-13 17:48:50 +02:00
parent db00accb57
commit 5e600d7ab4
1 changed files with 2 additions and 2 deletions

View File

@ -340,11 +340,11 @@ func init() {
keyNames["c-f"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlF, 0} keyNames["c-f"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlF, 0}
keyNames["c-g"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlG, 0} keyNames["c-g"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlG, 0}
keyNames["c-h"] = KeyStroke{tcell.ModNone, tcell.KeyCtrlH, 0} keyNames["c-h"] = KeyStroke{tcell.ModNone, tcell.KeyCtrlH, 0}
keyNames["c-i"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlI, 0} keyNames["c-i"] = KeyStroke{tcell.ModNone, tcell.KeyCtrlI, 0}
keyNames["c-j"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlJ, 0} keyNames["c-j"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlJ, 0}
keyNames["c-k"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlK, 0} keyNames["c-k"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlK, 0}
keyNames["c-l"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlL, 0} keyNames["c-l"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlL, 0}
keyNames["c-m"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlM, 0} keyNames["c-m"] = KeyStroke{tcell.ModNone, tcell.KeyCtrlM, 0}
keyNames["c-n"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlN, 0} keyNames["c-n"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlN, 0}
keyNames["c-o"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlO, 0} keyNames["c-o"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlO, 0}
keyNames["c-p"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlP, 0} keyNames["c-p"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlP, 0}