[patch 4/7] Cygwin/X: Invent a scan code if we dont have one

Paul Loewenstein paul.loewenstein@gmail.com
Sat Jan 17 02:58:00 GMT 2009


I plan to do a reasonably thorough investigation of what scan codes show 
up during speech recognition.  I believe I have seen both 0 and 1 (the 
ESC scancode).  The latter must be a bug (almost certainly Microsoft's) 
rather than a mere omission, but is much simpler to work around than to 
get fixed.  I believe it is safe to regenerate the scancode for ESC, for 
all keyboards, even if the scancode is provided.

Have you looked at using| MAPVK_VK_TO_VSC_EX |(3) instead of  
MAPVK_VK_TO_VSC(0)?  This may solve the numeric keypad/numlock problem 
described below. The code then has to look at the HIBYTE of the 
regenerated iParamScanCode to check for E0, the extended key scancode, 
and set KF_EXTENDED bit in HIWORD (lParam) if E0, then clear HIBYTE 
(iParamScanCode).

When num-lock is asserted; with my tentative fix (using MAPVK_VK_TO_VSC) 
saying "move to end of line" generates "1".  However, saying "press end" 
generates a fake "end" key correctly, I would guess by enclosing the 
simulated key with simulated num-lock keystrokes.

Another valid way of dealing with these keys in the absence of a scan 
code is to generate an extended key code (i.e. for the keys between the 
numeric keypad and the alphabetic keys).

To resolve some of the above guesswork, I need to quickly hack an 
application that displays both the virtual key code and the scan code, 
together with the extended key indication. I should be able to do that 
with a quick modification to publicly available code.  I can also modify 
it to test |MAPVK_VK_TO_VSC_EX|, which may solve the numeric keypad 
scancode problem problem cleanly by providing extended keycodes instead.

I would prefer to perform a clean, single fix.  I'll also use diff!!

Paul

Reini Urban wrote:
> Shouldn't we properly attribute Paul Loewenstein at least in the patch 
> who came up with this idea. 


Jon TURNEY wrote:
> Reini Urban wrote:
>> Shouldn't we properly attribute Paul Loewenstein at least in the 
>> patch who came up with this idea.
>
> Indeed, thanks for pointing out this oversight.
>
> Revised patch attached.
>
> That's what happens to people who don't use diff :-)
> ------------------------------------------------------------------------
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://x.cygwin.com/docs/
> FAQ:                   http://x.cygwin.com/docs/faq/


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



More information about the Cygwin-xfree mailing list