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");
193 emscripten_cancel_main_loop();
237 emscripten_set_main_loop(
loop, 0, 1);
#define SDL_GetScancodeName
#define SDL_StartTextInput
#define SDL_StopTextInput
#define SDL_LogSetPriority
#define SDL_IsTextInputActive
#define SDL_GL_CreateContext
@ SDL_LOG_CATEGORY_APPLICATION
GLuint GLsizei const GLchar * message
GLuint GLsizei GLsizei * length
#define SDL_WINDOWPOS_CENTERED
int main(int argc, char *argv[])
static void print_string(char **text, size_t *maxlen, const char *fmt,...)
static void PrintText(char *eventtype, char *text)
static void print_modifiers(char **text, size_t *maxlen)
static void PrintModifierState()
static void PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat)
EGLSurface EGLNativeWindowType * window
The SDL keysym structure, used in key events.
The type used to identify a window.
static char text[MAX_TEXT_LENGTH]