[Plib-cvs] plib/src/pw pwWindows.cxx,1.8,1.9
Brought to you by:
sjbaker
From: Wolfram K. <wol...@us...> - 2004-03-26 17:56:38
|
Update of /cvsroot/plib/plib/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15751 Modified Files: pwWindows.cxx Log Message: Typing "m" and "shift m" now return two different results, namely "m" and "M" :-). Index: pwWindows.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pw/pwWindows.cxx,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- pwWindows.cxx 24 Mar 2004 11:19:04 -0000 1.8 +++ pwWindows.cxx 26 Mar 2004 17:45:40 -0000 1.9 @@ -146,6 +146,19 @@ case VK_HOME: key = PW_KEY_HOME; break; case VK_END: key = PW_KEY_END; break; case VK_INSERT: key = PW_KEY_INSERT; break; + default: + // don't do this for WinCE + BYTE state[ 256 ]; + WORD code[ 2 ]; + + BOOL b = GetKeyboardState( state ); + assert(b); + + code [ 0 ] = 0; // WK: I need to do this, or on my Win2k box, the upper bits remain unchanged. + if( ToAscii( key, 0, state, code, 0 ) == 1 ) + if((0xFF00 & code[0]) == 0) // setting a high bit in key causes crashes later on (out of range array access) + key=code[ 0 ]; + } if ( key != -1 && kbCB ) (*kbCB) ( key, updown, lastx, lasty ) ; |