Correct get_key_name comment

This commit is contained in:
Guldoman
2021-12-23 00:06:24 +01:00
parent 590c8bb456
commit a122d7e916
+3 -3
View File
@@ -113,9 +113,9 @@ static const char *get_key_name(const SDL_Event *e, char *buf) {
scancode based name that matches the letter in the QWERTY layout.
In SDL, the codes of all special buttons such as control, shift, arrows
and others, are shifted using bit mask 1<<30(SDLK_SCANCODE_MASK) outside
the unicode range(>0x10FFFF). User can remap these buttons, so we need
to give correct name, not scancode based.*/
and others, are masked with SDLK_SCANCODE_MASK, which moves them outside
the unicode range (>0x10FFFF). Users can remap these buttons, so we need
to return the correct name, not scancode based. */
if ((e->key.keysym.sym < 128) || (e->key.keysym.sym & SDLK_SCANCODE_MASK))
strcpy(buf, SDL_GetKeyName(e->key.keysym.sym));
else