>Is it possible to bind modifiers besides Ctrl?>Ones like <Alt-Left>?
By the look of config/bindings.go it doesn't look like Alt is
supported. If I understand the code correctly, this part of the file is
declaring the available keybindings:
func init() {
keyNames = make(map[string]KeyStroke)
keyNames["space"] = KeyStroke{tcell.ModNone, tcell.KeyRune, ' '}
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["up"] = KeyStroke{tcell.ModNone, tcell.KeyUp, 0}
// …
You probably could add the support for Alt modifier (and maybe send a
patch) by adding more entries there. Alt+left could be something like
keyNames["a-left"] = KeyStroke{tcell.ModAlt, tcell.KeyLeft, 0}
It's just a sketch, I never tested if the line above works.
Ivan
On Tue Aug 23, 2022 at 8:58 AM EDT, Ivan Oleynikov wrote:
> >Is it possible to bind modifiers besides Ctrl?> >Ones like <Alt-Left>?>> By the look of config/bindings.go it doesn't look like Alt is> supported. If I understand the code correctly, this part of the file is> declaring the available keybindings:>> func init() {> keyNames = make(map[string]KeyStroke)> keyNames["space"] = KeyStroke{tcell.ModNone, tcell.KeyRune, ' '}> 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["up"] = KeyStroke{tcell.ModNone, tcell.KeyUp, 0}> // …>> You probably could add the support for Alt modifier (and maybe send a> patch) by adding more entries there. Alt+left could be something like>> keyNames["a-left"] = KeyStroke{tcell.ModAlt, tcell.KeyLeft, 0}
Have you tried 'M-left' and 'm-left'?
Cheers,
--
DJ Chase
They, Them, Theirs
On Wed Aug 24, 2022 at 7:15 AM EDT, Ivan Oleynikov wrote:
> >Have you tried 'M-left' and 'm-left'?>> No, I haven't. Is there a reason it should work? Neither docs nor code> seem to mention it.
It’s a common notation for alt keybindings. 'M' stands for meta, which
is usually bound to alt on Linux machines. For an example, see nano(1).
Cheers,
--
DJ Chase
They, Them, Theirs