delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/20/12:13:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.0.9.0.20030219135548.00aac350@rogue.codemeta.com>
X-Sender: lee AT rogue DOT codemeta DOT com (Unverified)
Date: Thu, 20 Feb 2003 12:10:51 -0500
To: john mapoles <jmapoles AT yahoo DOT com>, cygwin AT cygwin DOT com
From: "Lee D. Rothstein" <lee AT veritech DOT com>
Subject: Re: remapping Cygwin 'bash' readline functions to PC keys
In-Reply-To: <20030219160245.49683.qmail@web9808.mail.yahoo.com>
References: <5 DOT 2 DOT 0 DOT 9 DOT 0 DOT 20030218185859 DOT 103df640 AT rogue DOT codemeta DOT com>
Mime-Version: 1.0

John, thanks for the <C-V> heads up! Others had
suggested, variations of 'cat < foo' and 'od -c'. (The
former I got to work, the latter remains a mystery.)
Your solution, besides being the most straight-forward,
is also a great tool to have around. Apparently, it's a
feature of Cygwin, or 'bash', since it doesn't work in
a naked 'cmd.exe' window. I'll be sure to add it to my
documentation.

Unfortunately the key combos I'm trying to map to
are: <^-->> and <^-<-> (control- and the right and left
arrow keys). It turns out that the character string
outputs for both the:

* naked key
* shift - and the naked key
* control- and the naked key

are all the same.

Actually, I no longer consider these to be KIDs; these
are the character string graphemic outputs of hitting
the key. I'll continue to reserve "KIDs" for when one
represents these [and the key isomorphisms]
with '/e...', 'C-...', etc. "notation".

Apparently (?), the only way to discriminate among these
three alternatives is with Scan Codes. Apparently, all
the -x-ish stuff I've used (Microemacs, Thompson shell
command line editing) that can discriminate among the
three alternatives all use Scan Codes (?).

  - Any way to map to Scan Codes to 'bash' 'readline'
    functions under Cygwin?
    + Or to key "names" like: '<CTRL-left-arrow>',
      '<CTRL-HOME>'
  - Any interest among Cygwin developers in adding
    this?

 >At 2003-02-19 08:02 AM -0800, John Mapole wrote:
...
 >You can build your own KID table. Once at the cygwin
 >prompt you can type <C-V>, that's control-V, followed
 >by the key.  On my machine, if I type <C-V><INSERT>, I
 >see "^[[2~".  This is the same as "\e[2~".
 >
 >Why these mapping are like this relates to how windows
 >maps them and then how cygwin maps them.  Something I
 >am now very clear on.
 >
 >Hope this helps some.
 >
 >John Mapoles
 >
 >--- "Lee D. Rothstein" <lee AT veritech DOT com> wrote:
...
 >> Q1 -- When you remap a 'bash' Edit Mode function in
 >> .inputrc, it looks like this:
 >>
 >> "\e[3~":      delete-char # DEL key
 >>
 >> The entity in double quotes ("\e[3~"), I'm calling
 >> the "key ID (KID)". In the above '.inputrc' declaration,
 >> the function 'delete-char' being remapped from its
 >> default key assignment to the KID -- "\e[3~" -- the
 >> <DEL> key.
 >>
 >> What are the KIDs of the following IBM PC keys
 >> (specified below with facsimiles of the key caps
 >> contained in angle brackets -- '<...>')?
 >>
 >> Cursor control key pad
 >> ----------------------
 >> <HOME>
 >> <END>
 >> <left-arrow>
 >> <right-arrow>
 >> <PAGE_UP>
 >> <PAGE_DOWN>
 >> <INSERT>
 >>
 >> Numeric pad
 >> -----------
 >> <->
 >> <+>
 >> <ENTER>
 >> </>

I should have included in the above lists, all variations
of the above with the control, alt and shift keys.

 >> In general, I'd like a table that maps the KIDs for all
 >> 104 keys on the keyboard I use. Or, better still, is
 >> there a way to use scan codes?
 >>
 >> (Incidentally, what makes finding a table of these
 >> KIDs so difficult is the failure of the documentation
 >> to assign this concept a unique, or even a consistent
 >> word.)
 >>
 >> Q2
 >> --
 >>
 >> Is there a way to make the <INSERT> key a toggle
 >> between the insert and overwrite modes of 'bash'
 >> edit mode?
 >>
 >> I used to have these figured out for 'Microemacs',
 >> but that was half a lifetime ago, for me, & Microemacs
 >> supported scan codes, if I remember correctly.

--
Lee D. Rothstein -- lee AT veritech DOT com
VeriTech -- 603-424-2900
7 Merry Meeting Drive
Merrimack, NH 03054-2934  



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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