[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TerminalView bash Alt key shortcuts don't work but Ctrl ones do


On Fri, 26 Apr 2024 at 21:01, Bruce Steers <bsteers4@xxxxxxxxx> wrote:

> Is there a way to send Alt key shortcuts to the process?
> Or rather stop them being eaten by TerminalView.
>
> Ie..
> I found this bash key shortcut guide...
> https://github.com/fliptheweb/bash-shortcuts-cheat-sheet
>
> Seems with TerminalView all the Ctrl shortcuts listed there work with a
> bash shell but none of the Alt shortcuts do.
>
> I can detect the Alt presses in the TerminalView_KeyPress event but don't
> know how to send for example Atl+t manually as the component seems to eat
> all the Alt key events.
>
> Is there a workaround for this so ALL (or chosen) Alt+Key events input to
> the terminal like Ctrl+Key ones do?
>

After some experimenting I think I found an answer to my own question...

seems i can just send the key.text as an Escape char

Public Sub TerminalView1_KeyPress()

  If Key.Alt Then
    If Key.Text Then
      Stop Event  ' stop the key text printing
      TerminalView1.Input("\e" & Key.Text)
    Endif
  Endif
End

 Respects
BruceS

References:
TerminalView bash Alt key shortcuts don't work but Ctrl ones doBruce Steers <bsteers4@xxxxxxxxx>