Mail Archives: djgpp-workers/2001/06/12/14:58:00
> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Tue, 12 Jun 2001 09:37:10 -0400
>
> > If you mean the values in trans_mapping_chras_at, then I simply don't
> > understand them. If you do, perhaps you could explain; I tend to
> > dislike any code I cannot understand ;-)
>
> The comments in the example _inputrc provided by Bash explain the mapping:
> # Translation characters for extended keys
> # w/o SHIFT, CTRL, or ALT = "\e["
> # w/ SHIFT = "\e[1"
> # w/ CTRL = "\e[2"
> # w/ ALT = "\e[3"
>
> # then add for the key:
> # "A" = Up Arrow
> # "B" = Down Arrow
> # "C" = Right Arrow
> # "D" = Left Arrow
> # "E" = Insert
> # "F" = Delete
> # "G" = Home
> # "H" = End
> # "I" = Page Up
> # "J" = Page Down
> # "XA" = F1, "XB" = F2, "XC" = F3, "XD" = F4, "XE" = F5, "XF" = F6
> # "XG" = F7, "XH" = F8, "XI" = F9, "XJ" = F10, "XK" = F11, "XL" = F12
> #
>
> So the "up arrow" is encoded as:
> \e[A
> Shifted "up arrow":
> \e[1A
> Ctrl "up arrow":
> \e[2A
Thanks.
Yes, I understood that part, but I cannot figure out _why_. Why
couldn't the code just have a single table where each key has its
escape sequence? Is it just to save a few bytes of the leading "\e["
sequence?
Also, I couldn't find a single terminal among the more popular ones
where F1 produces "\e[XA". On vt100 it produces "\e[11~", for
example, and the same is true for xterm.
- Raw text -