This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


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

Re: Keyboard handling


On Thu, Apr 05, 2001 at 12:13:37PM -0400, Harold Hunt wrote:
> I need a volunteer with an AltGr equipped keyboard and Spy++ to tell me the
> difference between a normal VK_CONTROL WM_KEYDOWN message and the VK_CONTROL
> WM_KEYDOWN message that immediately preceeds an extended (right key) VK_MENU
> message.
> 
> For comparison, on a US keyboard I get the following messages when I press
> left control followed by right alt, then I release left control and finally
> release right alt:
> 1) WM_KEYDOWN nVirtKey: VK_CONTROL ScanCode: 1D fExtended: 0 fAltDown: 0
> 2) WM_KEYDOWN nVirtKey: VK_MENU ScanCode: 38 fExtended: 1 fAltDown: 1
> 3) WM_SYSKEYUP nVirtKey: VK_CONTROL ScanCode: 1D fExtended: 0 fAltDown: 1
> 4) WM_KEYUP nVirtKey: VK_MENU ScanCode: 38 fExtended: 1 fAltDown: 0
> 
> Microsoft claims that pressing AltGr will generate the following sequence of
> messages:
> 1) WM_KEYDOWN nVirtKey: VK_CONTROL ScanCode: ?? fExtended: ? fAltDown: ?
> 2) WM_KEYDOWN nVirtKey: VK_MENU ScanCode: ?? fExtended: ? fAltDown: ?
> 3) WM_KEYUP nVirtKey: VK_CONTROL ScanCode: ?? fExtended: ? fAltDown: ?
> 4) WM_SYSKEYUP nVirtKey: VK_MENU ScanCode: ?? fExtended: ? fAltDown: ?
> 
> I need someone to fill in the blanks on the sequence of messages that AltGr
> is supposed to generate; specifically, I need to know the ScanCodes,
> fExtended state, and fAltDown state.
> 
> I have recreated the keyboard handling using Alexander's technique, and the
> only remaining key that I need to work on is AltGr.

I don't have Spy++ but I have `cygcheck' from the Cygwin distro.
It gives keyboard specific inofrmation by calling `cygcheck -k'.
That should help you. I'm somewhat surprised about the above
layout of the output. There's only a "fAltDown" but as you might
know, the keyboard set's different bits in the status flags for
left and right Alt.

That's the output of your above example, using `cygcheck -k'
and a german keyboard:

("Pressed" means KEYDOWN, "Released" means KEYUP)

Pressing LeftCtrl:
==================

Pressed  1x VK: 0x11 VS: 0x1d A: 0x00 CTRL: -- -- -- LC NL -- -- -- --
            ^^^^^^^^ ^^^^^^^^ ^^^^^^^                               ^^
         ^  virtual  virtual  ascii                              ^^ Shift
         |  keycode  scancode char                            ^^ Scrolllock
	 |                                                 ^^ Right Control
	 repeat                                         ^^ Right Alt
	 count                                       ^^ Numlock
                                                  ^^ Left Control
					       ^^ Left Alt
					    ^^ Enhanced key
					    Capslock

Pressing RightAlt:
==================

Pressed  1x VK: 0x12 VS: 0x38 A: 0x00 CTRL: -- EK -- LC NL RA -- -- --

Releasing LeftCtrl:
===================

Released 1x VK: 0x11 VS: 0x1d A: 0x00 CTRL: -- -- -- -- NL RA -- -- --
Pressed  1x VK: 0x12 VS: 0x38 A: 0x00 CTRL: -- EK -- LC NL RA -- -- --

(yes, two messages, indeed)

Releasing RightAlt:
===================

Released 1x VK: 0x12 VS: 0x38 A: 0x00 CTRL: -- EK -- -- NL -- -- -- --


> 
> Harold

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


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