forked from Green-Sky/tomato
Merge commit '852f2a6343518919e5ca8d3c1bbcab9f493e3cd8'
This commit is contained in:
13
external/sdl/SDL/test/checkkeys.c
vendored
13
external/sdl/SDL/test/checkkeys.c
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@ -165,7 +165,7 @@ static void loop(void)
|
||||
switch (event.type) {
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
case SDL_EVENT_KEY_UP:
|
||||
PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED) ? SDL_TRUE : SDL_FALSE, (event.key.repeat) ? SDL_TRUE : SDL_FALSE);
|
||||
PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED), (event.key.repeat > 0));
|
||||
if (event.type == SDL_EVENT_KEY_DOWN) {
|
||||
switch (event.key.keysym.sym) {
|
||||
case SDLK_BACKSPACE:
|
||||
@ -182,10 +182,6 @@ static void loop(void)
|
||||
case SDL_EVENT_TEXT_EDITING:
|
||||
PrintText("EDIT", event.edit.text);
|
||||
break;
|
||||
case SDL_EVENT_TEXT_EDITING_EXT:
|
||||
PrintText("EDIT_EXT", event.editExt.text);
|
||||
SDL_free(event.editExt.text);
|
||||
break;
|
||||
case SDL_EVENT_TEXT_INPUT:
|
||||
PrintText("INPUT", event.text.text);
|
||||
SDLTest_TextWindowAddText(textwin, "%s", event.text.text);
|
||||
@ -245,7 +241,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return 1;
|
||||
}
|
||||
state->window_title = "CheckKeys Test";
|
||||
@ -261,9 +257,6 @@ int main(int argc, char *argv[])
|
||||
/* Disable mouse emulation */
|
||||
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
|
||||
|
||||
/* Enable extended text editing events */
|
||||
SDL_SetHint(SDL_HINT_IME_SUPPORT_EXTENDED_TEXT, "1");
|
||||
|
||||
/* Initialize SDL */
|
||||
if (!SDLTest_CommonInit(state)) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
|
Reference in New Issue
Block a user