~rjarry/aerc-discuss

6 4

Modifiers besides Ctrl?

John Gebbie <me@johngebbie.com>
Details
Message ID
<CMDCWFMABVA3.2QV002N6V9IJ4@d>
DKIM signature
missing
Download raw message
Is it possible to bind modifiers besides Ctrl?
Ones like <Alt-Left>?
Thanks.
Details
Message ID
<20220823125811.3eumtrjhiofahvxg@arch>
In-Reply-To
<CMDCWFMABVA3.2QV002N6V9IJ4@d> (view parent)
DKIM signature
missing
Download raw message
>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
Details
Message ID
<CMDL9MO3PUMC.39P4KKEYMATNE@grinningface>
In-Reply-To
<20220823125811.3eumtrjhiofahvxg@arch> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<20220824111526.mewon6wbzct6dg7d@arch>
In-Reply-To
<CMDL9MO3PUMC.39P4KKEYMATNE@grinningface> (view parent)
DKIM signature
missing
Download raw message
>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.
Details
Message ID
<CMEEFVTKT8RV.1JXG2WEGRZ0R7@grinningface>
In-Reply-To
<20220824111526.mewon6wbzct6dg7d@arch> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<9777C881-9A67-4999-B2D3-EDDA90BD6F0B@jarry.cc>
In-Reply-To
<CMEEFVTKT8RV.1JXG2WEGRZ0R7@grinningface> (view parent)
DKIM signature
missing
Download raw message
Hi,

No Alt- M- modifiers are supported at the moment.

https://todo.sr.ht/~rjarry/aerc/68
John Gebbie <me@johngebbie.com>
Details
Message ID
<CMGAESAXMK7B.3UOJIIFJQUAPU@d>
In-Reply-To
<20220824111526.mewon6wbzct6dg7d@arch> (view parent)
DKIM signature
missing
Download raw message
I sent a patch: https://lists.sr.ht/~rjarry/aerc-devel/patches/34953
Reply to thread Export thread (mbox)