> I've tested your version with FLTK 2.0 now, and it looks as if there are
> problems if you press (and hold) both shift keys simultaneously and/or
> with the resulting auto-repeat keypresses when you hold'em down for a
> longer time.
>
> I hacked a POC how to make it better, but this still doesn't fix *ALL*
> keypress combinations I tested, although it seems to work better than
> your version. Points taken into account:
>
>  - check key state only when Windows says it's VK_SHIFT
>  - save the last keydown key (left/right)
>  - check all toggle states by comparing saved and current state
>
Yes, this was a slight oversight on my part - I forgot that the user 
could release another key before releasing shift!
This is fixed, and I've added in the vk == VK_SHIFT test too.
It seems that Win32 doesn't send autorepeat events for shift keys - only 
for 'actual' keys. This screws with the shift detection, but this should 
hopefully be fixed.
It also seems that it doesn't bother sending a WM_KEYUP message if the 
user holds left *and* right shift, and then releases one of them. I 
suppose this makes sense given that Windows deems left/right shift to be 
the same key. I have an idea on how to fix this, but I'll commit it 
sometime later today as I've got to head out to work.

Regards,
Ben

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

Reply via email to