aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Terpstra <erik@nixhub.nl>2023-10-30 14:09:01 +0100
committerRobin Jarry <robin@jarry.cc>2023-11-12 12:53:11 +0100
commitcf00d0b55f29929d0c5996026d770067d4b26aa8 (patch)
tree29245887c99f8ce7e63386158d4b8d975f062566
parenta35d9bab4664bb60163cfce53faa4eb68c1a69f3 (diff)
downloadaerc-cf00d0b55f29929d0c5996026d770067d4b26aa8.tar.gz
binds: allow <a-0> to <a-9>
Add support for Alt+<number> keys. Update documentation for it. Changelog-added: Allow binding commands to `Alt+<number>` keys. Signed-off-by: Erik Terpstra <erik@nixhub.nl> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--config/binds.go10
-rw-r--r--doc/aerc-binds.5.scd20
2 files changed, 30 insertions, 0 deletions
diff --git a/config/binds.go b/config/binds.go
index 1ea36a2d..8eda890d 100644
--- a/config/binds.go
+++ b/config/binds.go
@@ -629,6 +629,16 @@ var keyNames = map[string]KeyStroke{
"c-^": {tcell.ModCtrl, tcell.KeyCtrlCarat, 0},
"c-_": {tcell.ModCtrl, tcell.KeyCtrlUnderscore, 0},
"a-space": {tcell.ModAlt, tcell.KeyRune, ' '},
+ "a-0": {tcell.ModAlt, tcell.KeyRune, '0'},
+ "a-1": {tcell.ModAlt, tcell.KeyRune, '1'},
+ "a-2": {tcell.ModAlt, tcell.KeyRune, '2'},
+ "a-3": {tcell.ModAlt, tcell.KeyRune, '3'},
+ "a-4": {tcell.ModAlt, tcell.KeyRune, '4'},
+ "a-5": {tcell.ModAlt, tcell.KeyRune, '5'},
+ "a-6": {tcell.ModAlt, tcell.KeyRune, '6'},
+ "a-7": {tcell.ModAlt, tcell.KeyRune, '7'},
+ "a-8": {tcell.ModAlt, tcell.KeyRune, '8'},
+ "a-9": {tcell.ModAlt, tcell.KeyRune, '9'},
"a-a": {tcell.ModAlt, tcell.KeyRune, 'a'},
"a-b": {tcell.ModAlt, tcell.KeyRune, 'b'},
"a-c": {tcell.ModAlt, tcell.KeyRune, 'c'},
diff --git a/doc/aerc-binds.5.scd b/doc/aerc-binds.5.scd
index 99ef1188..f9cdd668 100644
--- a/doc/aerc-binds.5.scd
+++ b/doc/aerc-binds.5.scd
@@ -210,6 +210,26 @@ special keys are supported:
: Ctrl+Space
| *<a-space>*
: Alt+Space
+| *<a-0>*
+: Alt+0
+| *<a-1>*
+: Alt+1
+| *<a-2>*
+: Alt+2
+| *<a-3>*
+: Alt+3
+| *<a-4>*
+: Alt+4
+| *<a-5>*
+: Alt+5
+| *<a-6>*
+: Alt+6
+| *<a-7>*
+: Alt+7
+| *<a-8>*
+: Alt+8
+| *<a-9>*
+: Alt+9
| *<c-a>*
: Ctrl+a
| *<a-a>*