Go to the documentation of this file.
23 #include <emscripten/emscripten.h>
48 if ( ((
size_t)
len) < *maxlen ) {
118 "Key %s: scancode %d = %s, keycode 0x%08X = %s ",
119 pressed ?
"pressed " :
"released",
125 "Unknown Key (scancode %d = %s) %s ",
128 pressed ?
"pressed " :
"released");
140 char *spot, expanded[1024];
143 for ( spot =
text; *spot; ++spot )
148 SDL_Log(
"%s Text (%s): \"%s%s\"\n", eventtype, expanded, *
text ==
'"' ?
"\\" :
"",
text);
159 switch (
event.type) {
176 SDL_Log(
"Stopping text input\n");
179 SDL_Log(
"Starting text input\n");
191 #ifdef __EMSCRIPTEN__
193 emscripten_cancel_main_loop();
236 #ifdef __EMSCRIPTEN__
237 emscripten_set_main_loop(
loop, 0, 1);
static void PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat)
#define SDL_WINDOWPOS_CENTERED
@ SDL_LOG_CATEGORY_APPLICATION
GLuint GLsizei const GLchar * message
#define SDL_GL_CreateContext
GLuint GLsizei GLsizei * length
The type used to identify a window.
#define SDL_StopTextInput
EGLSurface EGLNativeWindowType * window
static void PrintText(char *eventtype, char *text)
static char text[MAX_TEXT_LENGTH]
#define SDL_StartTextInput
#define SDL_GetScancodeName
static void PrintModifierState()
static void print_string(char **text, size_t *maxlen, const char *fmt,...)
#define SDL_LogSetPriority
The SDL keysym structure, used in key events.
int main(int argc, char *argv[])
static void print_modifiers(char **text, size_t *maxlen)
#define SDL_IsTextInputActive