MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / PrintKey

Function PrintKey

deps/SDL2/test/checkkeys.c:105–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105static void
106PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat)
107{
108 char message[512];
109 char *spot;
110 size_t left;
111
112 spot = message;
113 left = sizeof(message);
114
115 /* Print the keycode, name and state */
116 if (sym->sym) {
117 print_string(&spot, &left,
118 "Key %s: scancode %d = %s, keycode 0x%08X = %s ",
119 pressed ? "pressed " : "released",
120 sym->scancode,
121 SDL_GetScancodeName(sym->scancode),
122 sym->sym, SDL_GetKeyName(sym->sym));
123 } else {
124 print_string(&spot, &left,
125 "Unknown Key (scancode %d = %s) %s ",
126 sym->scancode,
127 SDL_GetScancodeName(sym->scancode),
128 pressed ? "pressed " : "released");
129 }
130 print_modifiers(&spot, &left);
131 if (repeat) {
132 print_string(&spot, &left, " (repeat)");
133 }
134 SDL_Log("%s\n", message);
135}
136
137static void
138PrintText(char *eventtype, char *text)

Callers 1

loopFunction · 0.85

Calls 5

print_stringFunction · 0.85
SDL_GetScancodeNameFunction · 0.85
SDL_GetKeyNameFunction · 0.85
print_modifiersFunction · 0.85
SDL_LogFunction · 0.85

Tested by

no test coverage detected