delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/12/09:38:33

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Date: Tue, 12 Jun 2001 09:37:10 -0400
MIME-Version: 1.0
Subject: Re: old archived termios submission
Message-ID: <3B25E2C6.1862.71445@localhost>
References: <3B25001A DOT 18075 DOT 735B29 AT localhost>
In-reply-to: <Pine.SUN.3.91.1010612114840.1700M-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

> 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

etc.

- Raw text -


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