This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Small request for the new cygwin terminal


On 7 June 2012 17:10, Helmut Karlowski wrote:
> Helmut Karlowski, 07.06.2012 17:52:43:
>
>
>> Nellis, Kenneth, 07.06.2012 16:56:57:
>>
>>> -----Original Message-----
>>> From: Andy Koppe
>>> <snip/>
>>> It is done on purpose, to allow Shift+Esc to be bound to a different
>>> function if desired. It's documented here:
>>>
>>> [1] http://code.google.com/p/mintty/wiki/Keycodes#Special_keys
>>>
>>> Shift+ESC sends the Unicode codepoint U+009B, aka the Control Sequence
>>> Introducer (CSI) character.
>>> <snip/>
>>> -----END Original Message-----
>>>
>>> My experience does not agree with the "Special keys" table at the
>>> page referenced by that URL.
>>
>>
>> On my german keyboard I receive ^[^[ (2x ESC) for Shift-ESC. Character Set
>> is CP850 if that matters. As of my understanding CSI is something like ESC[
>> (at least on an ANSI-terminal, is this different on xterm?).
>
>
> Switching to ISO-8859-1 emits 0x9b which seems to be correct.

See the preceding section on the wiki page:

http://code.google.com/p/mintty/wiki/Keycodes#Ctrl

"If Shift is held in addition to a control character combination, the
corresponding character from the so-called C1 control character set is
sent. The C1 control characters are shown as Unicode codepoints in the
table below. How exactly C1 control characters are sent depends on the
selected character encoding. In ISO-8859 encodings, they are encoded
as single bytes, e.g. \x81 for U+0081. With UTF-8, they are encoded as
two-byte sequences, which effectively means that the character code is
prefixed with a \xC2 byte, so for example U+0081 becomes \xC2\x81. C1
codepoints that are not supported by the selected character encoding
are sent by prefixing the corresponding ASCII control character with
an ESC character, so U+0081 would be sent as ^[^A."

CP850 doesn't support the C1 control characters, so you get the
fallback instead, which is the scheme for encoding the Meta modifier
when bit 7 isn't available. This means that Ctrl+Shift+letter
combinations can't be distinguished from Ctrl+Alt+letter, but since
Ctrl+Alt+letter combinations are suppposedly reserved for global
shortcuts in Windows, they might still come in handy occasionally.

There indeed is another scheme of encoding C1 control characters with
an ESC followed by the base character, e.g. ^[A instead of ^[^A, but
that would have made the Ctrl+Shift+letter keycode the same as
Alt+letter rather than Ctrl+Alt+letter, which is why I chose the Meta
scheme.

I hope that makes some sense.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]