|Re: [AD] 4.9.10 this weekend|
[ Thread Index |
| More lists.liballeg.org/allegro-developers Archives
2009/5/1 Elias Pschernig <elias.pschernig@xxxxxxxxxx>:
> WM_KEYDOWN has the same information I think (the "virtual keycode"):
> 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).
I tried it and it's not simple at all. Will need to remap the
translation table from DX -> Allegro to VK ->Allegro.
And getting the WM_CHAR message is all but trivial. You need to call
TranslateMessage() inside WM_KEYDOWN handler but you can't know if
WM_CHAR will be generated, unless you do tricks, and you lose the
virtual keycode in WM_CHAR... I've got some code code, maybe I'll
finish it some day.