console enhancements: mouse events

Corinna Vinschen
Sat Nov 7 10:08:00 GMT 2009

On Nov  6 21:55, Andy Koppe wrote:
> 2009/11/6 Thomas Wolff:
> > * I would like to fix some key assignments:
> >  - Control-(Shift-)6 inputs Control-^ which is not proper on international
> >    keyboards if Shift-6 is not "^", Control-^ (the key) does not input
> >    Control-^ (the character) on the other hand; the same glitch
> >    occurs in the pure Windows console, however.
> >    Unfortunately, with the functions being used it is not possible to
> >    detect that shifted key "^" was hit together with Control; only
> >    keycodes/scancodes are available when Control/Shift/Alt are used. So
> >    I don't know whether this can easily be fixed. It works in mintty but
> >    I think mintty uses different Windows functions.
> Mintty roughly does the following for Ctrl(+Shift)+symbol combinations:
> - obtain the keymap using GetKeyboardState()
> - set the state of the Ctrl key to released
> - invoke ToUnicode() to get the character code according to the keyboard layout
> - if the character code is one of [\]_^? send the corresponding control code
> - otherwise, set the state of both Ctrl and Alt to pressed (this is
> equivalent to AltGr), and try ToUnicode() again
> The last step means that e.g. Ctrl+9 on a German keyboard will send
> ^]. The proper combination would be Ctrl+AltGr+9, but since
> AltGr==Ctrl+Alt, that can't be distinguished from AltGr+9 without
> Ctrl. (Well, not without somewhat dodgy trickery anyway.)

How does that work for ^^?  The ^ key is a deadkey on the german keyboard
layout, so the actual char value is only generated after pressing the key
twice.  Just curious.

> Btw, ^[, ^], and ^\ are actually available as Ctrl+ü, Ctrl+plus, and
> Ctrl+# in the German keyboard layout, but those combinations make no
> sense unless you're familiar with the US layout.



Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-patches mailing list