delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/12/14:58:00

Date: Tue, 12 Jun 2001 20:50:16 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Mark E." <snowball3 AT bigfoot DOT com>
Message-Id: <2561-Tue12Jun2001205015+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3B25E2C6.1862.71445@localhost> (snowball3@bigfoot.com)
Subject: Re: old archived termios submission
References: <3B25001A DOT 18075 DOT 735B29 AT localhost> <3B25E2C6 DOT 1862 DOT 71445 AT localhost>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019