src/video/windows/SDL_windowsevents.c
changeset 7646 42c3b0c24c6c
parent 7645 cc775832d501
child 7647 832a72fc1c94
equal deleted inserted replaced
7645:cc775832d501 7646:42c3b0c24c6c
   485         returnCode = 0;
   485         returnCode = 0;
   486         break;
   486         break;
   487 #endif /* WM_MOUSELEAVE */
   487 #endif /* WM_MOUSELEAVE */
   488 
   488 
   489     case WM_KEYDOWN:
   489     case WM_KEYDOWN:
   490         {
   490     case WM_SYSKEYDOWN:
       
   491         {
       
   492             SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam );
       
   493             if ( code != SDL_SCANCODE_UNKNOWN ) {
       
   494                 SDL_SendKeyboardKey(SDL_PRESSED, code );
       
   495             }
       
   496         }
       
   497         if (msg == WM_KEYDOWN) {
   491             BYTE keyboardState[256];
   498             BYTE keyboardState[256];
   492             char text[5];
   499             char text[5];
   493             UINT32 utf32 = 0;
   500             UINT32 utf32 = 0;
   494 
   501 
   495             GetKeyboardState(keyboardState);
   502             GetKeyboardState(keyboardState);
   497                 WORD repitition;
   504                 WORD repitition;
   498                 for (repitition = lParam & 0xffff; repitition > 0; repitition--) {
   505                 for (repitition = lParam & 0xffff; repitition > 0; repitition--) {
   499                     WIN_ConvertUTF32toUTF8(utf32, text);
   506                     WIN_ConvertUTF32toUTF8(utf32, text);
   500                     SDL_SendKeyboardText(text);
   507                     SDL_SendKeyboardText(text);
   501                 }
   508                 }
   502             }
       
   503         }
       
   504         // no break
       
   505     case WM_SYSKEYDOWN:
       
   506         {
       
   507             SDL_Scancode code = WindowsScanCodeToSDLScanCode( lParam, wParam );
       
   508             if ( code != SDL_SCANCODE_UNKNOWN ) {
       
   509                 SDL_SendKeyboardKey(SDL_PRESSED, code );
       
   510             }
   509             }
   511         }
   510         }
   512         returnCode = 0;
   511         returnCode = 0;
   513         break;
   512         break;
   514 
   513