aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJohn Gebbie <me@johngebbie.com>2022-09-01 09:54:43 +0100
committerRobin Jarry <robin@jarry.cc>2022-09-13 22:50:16 +0200
commit14ddc0de8d2bdd96347cc28d1cea4da74dd775d9 (patch)
treeddb82abdb86609ebf3b659dbd80f401b1db1bcc3 /config
parentabf6ec7f02edbf8721fb32e4e760ebda2c20bc50 (diff)
downloadaerc-14ddc0de8d2bdd96347cc28d1cea4da74dd775d9.tar.gz
bindings: add alt modifier
Enables bindings like <A-left>. Signed-off-by: John Gebbie <me@johngebbie.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r--config/bindings.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/config/bindings.go b/config/bindings.go
index 18a872b0..7816296a 100644
--- a/config/bindings.go
+++ b/config/bindings.go
@@ -241,14 +241,19 @@ func init() {
keyNames["semicolon"] = KeyStroke{tcell.ModNone, tcell.KeyRune, ';'}
keyNames["enter"] = KeyStroke{tcell.ModNone, tcell.KeyEnter, 0}
keyNames["c-enter"] = KeyStroke{tcell.ModCtrl, tcell.KeyEnter, 0}
+ keyNames["a-enter"] = KeyStroke{tcell.ModAlt, tcell.KeyEnter, 0}
keyNames["up"] = KeyStroke{tcell.ModNone, tcell.KeyUp, 0}
keyNames["c-up"] = KeyStroke{tcell.ModCtrl, tcell.KeyUp, 0}
+ keyNames["a-up"] = KeyStroke{tcell.ModAlt, tcell.KeyUp, 0}
keyNames["down"] = KeyStroke{tcell.ModNone, tcell.KeyDown, 0}
keyNames["c-down"] = KeyStroke{tcell.ModCtrl, tcell.KeyDown, 0}
+ keyNames["a-down"] = KeyStroke{tcell.ModAlt, tcell.KeyDown, 0}
keyNames["right"] = KeyStroke{tcell.ModNone, tcell.KeyRight, 0}
keyNames["c-right"] = KeyStroke{tcell.ModCtrl, tcell.KeyRight, 0}
+ keyNames["a-right"] = KeyStroke{tcell.ModAlt, tcell.KeyRight, 0}
keyNames["left"] = KeyStroke{tcell.ModNone, tcell.KeyLeft, 0}
keyNames["c-left"] = KeyStroke{tcell.ModCtrl, tcell.KeyLeft, 0}
+ keyNames["a-left"] = KeyStroke{tcell.ModAlt, tcell.KeyLeft, 0}
keyNames["upleft"] = KeyStroke{tcell.ModNone, tcell.KeyUpLeft, 0}
keyNames["upright"] = KeyStroke{tcell.ModNone, tcell.KeyUpRight, 0}
keyNames["downleft"] = KeyStroke{tcell.ModNone, tcell.KeyDownLeft, 0}
@@ -256,8 +261,10 @@ func init() {
keyNames["center"] = KeyStroke{tcell.ModNone, tcell.KeyCenter, 0}
keyNames["pgup"] = KeyStroke{tcell.ModNone, tcell.KeyPgUp, 0}
keyNames["c-pgup"] = KeyStroke{tcell.ModCtrl, tcell.KeyPgUp, 0}
+ keyNames["a-pgup"] = KeyStroke{tcell.ModAlt, tcell.KeyPgUp, 0}
keyNames["pgdn"] = KeyStroke{tcell.ModNone, tcell.KeyPgDn, 0}
keyNames["c-pgdn"] = KeyStroke{tcell.ModCtrl, tcell.KeyPgDn, 0}
+ keyNames["a-pgdn"] = KeyStroke{tcell.ModAlt, tcell.KeyPgDn, 0}
keyNames["home"] = KeyStroke{tcell.ModNone, tcell.KeyHome, 0}
keyNames["end"] = KeyStroke{tcell.ModNone, tcell.KeyEnd, 0}
keyNames["insert"] = KeyStroke{tcell.ModNone, tcell.KeyInsert, 0}
@@ -365,6 +372,38 @@ func init() {
keyNames["c-["] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlLeftSq, 0}
keyNames["c-^"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlCarat, 0}
keyNames["c-_"] = KeyStroke{tcell.ModCtrl, tcell.KeyCtrlUnderscore, 0}
+ keyNames["a-space"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, ' '}
+ keyNames["a-a"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'a'}
+ keyNames["a-b"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'b'}
+ keyNames["a-c"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'c'}
+ keyNames["a-d"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'd'}
+ keyNames["a-e"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'e'}
+ keyNames["a-f"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'f'}
+ keyNames["a-g"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'g'}
+ keyNames["a-h"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'h'}
+ keyNames["a-i"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'i'}
+ keyNames["a-j"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'j'}
+ keyNames["a-k"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'k'}
+ keyNames["a-l"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'l'}
+ keyNames["a-m"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'm'}
+ keyNames["a-n"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'n'}
+ keyNames["a-o"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'o'}
+ keyNames["a-p"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'p'}
+ keyNames["a-q"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'q'}
+ keyNames["a-r"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'r'}
+ keyNames["a-s"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 's'}
+ keyNames["a-t"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 't'}
+ keyNames["a-u"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'u'}
+ keyNames["a-v"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'v'}
+ keyNames["a-w"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'w'}
+ keyNames["a-x"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'x'}
+ keyNames["a-y"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'y'}
+ keyNames["a-z"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, 'z'}
+ keyNames["a-]"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, ']'}
+ keyNames["a-\\"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, '\\'}
+ keyNames["a-["] = KeyStroke{tcell.ModAlt, tcell.KeyRune, '['}
+ keyNames["a-^"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, '^'}
+ keyNames["a-_"] = KeyStroke{tcell.ModAlt, tcell.KeyRune, '_'}
keyNames["nul"] = KeyStroke{tcell.ModNone, tcell.KeyNUL, 0}
keyNames["soh"] = KeyStroke{tcell.ModNone, tcell.KeySOH, 0}
keyNames["stx"] = KeyStroke{tcell.ModNone, tcell.KeySTX, 0}