Re: [AD] 4.9.10 this weekend

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 2009-05-01 at 10:45 +1000, Peter Wang wrote:
> 2009/5/1 Milan Mimica <milan.mimica@xxxxxxxxxx>:
> > Elias Pschernig wrote:
> >>
> >> There's two ways to fix it - do it like in A4, or get rid of the DInput
> >> keyboard driver. I have no idea how either of them would be done - but
> >> I'd be strongly in favor of getting rid of the DInput driver (and catch
> >> the key presses/releases from the message loop).
> >
> > There must be reason why dinput was used in the first place.
> 
> So that "event.keyboard.keycode" corresponds to physical keys, not the
> character generated when the key is pressed under the current keyboard
> layout?  At least that's what I remember.
> 

WM_KEYDOWN has the same information I think (the "virtual keycode"):

http://msdn.microsoft.com/en-us/library/ms646280(VS.85).aspx

Plus, the WM_KEYDOWN arrives at the exact same time and without any of
the DX overhead. There might of course be some detail problems when
trying to implement the driver, can't know before trying. But I think if
done cleanly, it could be much less code than the DX code, and also
without the need to query that 256 byte keyboard state at each press.
Also getting the unicode symbols will be trivial (WM_CHAR message) and
without any failure possibilities like the current driver which ignores
the Shift state (as Windows itself would do all the key translation
stuff for for us and just report the final unicode).

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/