SDL_dibevents.c - Key-fix for WinCE

Seems that under WinCE, any key that can’t translate to UNICODE became
an unknown key. Don’t know why the programmers weren’t keeping the
untranslated virtual key instead of using the translated one, but when I
commented out these three lines, the WinCE directional pad started
generating proper SDLKEY_LEFT etc. Fix is as follows:

/* this is the workaround for the missing ToAscii() and ToUnicode()
in CE (not necessary at KEYUP!) */
if ( SDL_TranslateUNICODE ) {
MSG m;

m.hwnd = hwnd;
m.message = msg;
m.wParam = wParam;
m.lParam = lParam;
m.time = 0;
if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER,

PM_NOREMOVE) && (m.message == WM_CHAR) ) {
GetMessage(&m, hwnd, 0, WM_USER);
// wParam = m.wParam; //Why are we doing this?
} else {
// wParam = 0; //Again
} else {
// wParam = 0; //again

Oh, forgot to mention. The WinCE code still generates some SDLKEY_UNKNOWN
keysyms along with the normal movement pad ones; closer examination
revealed that WinCE was putting through some VK_F21 and VK_F22 messages for
reasons I cannot fathom.