test/checkkeys.c
changeset 11220 54ea94875b88
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
equal deleted inserted replaced
11219:f94279990934 11220:54ea94875b88
   166             break;
   166             break;
   167         case SDL_TEXTINPUT:
   167         case SDL_TEXTINPUT:
   168             PrintText("INPUT", event.text.text);
   168             PrintText("INPUT", event.text.text);
   169             break;
   169             break;
   170         case SDL_MOUSEBUTTONDOWN:
   170         case SDL_MOUSEBUTTONDOWN:
   171             /* Any button press quits the app... */
   171             /* Left button quits the app, other buttons toggles text input */
       
   172             if (event.button.button == SDL_BUTTON_LEFT) {
       
   173                 done = 1;
       
   174             } else {
       
   175                 if (SDL_IsTextInputActive()) {
       
   176                     SDL_Log("Stopping text input\n");
       
   177                     SDL_StopTextInput();
       
   178                 } else {
       
   179                     SDL_Log("Starting text input\n");
       
   180                     SDL_StartTextInput();
       
   181                 }
       
   182             }
       
   183             break;
   172         case SDL_QUIT:
   184         case SDL_QUIT:
   173             done = 1;
   185             done = 1;
   174             break;
   186             break;
   175         default:
   187         default:
   176             break;
   188             break;