On 28.03.2011 12:40, Ben Stott wrote:
> As a follow up, almost 2 months later:
>
> On 07/02/11 23:20, Albrecht Schlosser wrote:
>> On 07.02.2011 03:40, Ben Stott wrote:
>>
>>> As noted in #2527, the keyboard demo fails to pick up the right shift
>>> key, instead claiming it to be a left shift.
>>> This is because lParam&(1<<24) is 0 for the shift key, and only the
>>> shift key, though I've no idea why this is the case (it *is* noted in
>>> the keyboard demo as a known bug of Windows - at least, on 2.0).
>> IMHO it's not worth the effort, because it will fail anyway in some or
>> more cases - unless MS decide to do it The Right Way. To your questions:
>> I'd close the STR w/o resolution.
>
> SVN r8535 has a fix for 2.0 on this. It just uses a boolean flag and 
> GetKeyState
> to determine whether or not rshift has been pressed/released. I've tested this
> relatively thoroughly and it looks like it holds up. If you want, I can see 
> if I
> can bash together a 1.3 patch, or you can knock up your own...?

I'd like to take your idea, create a patch, see what I can
find out about it, and if it's something different, share it with
you.

> Just thought I'd pass along the heads up :-)

Thanks, I saw your commit and the note in the STR, and I wanted to reply,
but somehow I lost it...

I looked into it, and it looked okay so far, but I'm wondering whether
you could check the key state only when you know it's a SHIFT key anyway.
This might filter lots of GetKeyState() calls for unrelated key events.
I started investigating whether someone in the 'net would tell how
"expensive" GetKeyState was, but then something interrupted my research, and
I still don't know. Maybe you found something about it? IIRC there are more
calls to GetKeyState() in the code anyway, so it is maybe not very expensive.

One more for my curiosity: Earlier in this thread you wrote:
"GetKeyState() ... seemed to be static in my tests - hitting right shift and 
then any left modifing key would see the keyboard demo report a right key until 
right shift was hit *again*,..."

Now it seems to work as expected. What changed?

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to