Commit 27543a45 authored by deuce's avatar deuce
Browse files

Translate non-printing input characters using the codepage, don't assume

anything that doesn't print is "fine".
parent ca208843
......@@ -827,8 +827,14 @@ static void sdl_video_event_thread(void *data)
break;
}
}
if (block_text || ev.key.keysym.sym < 0 || ev.key.keysym.sym > 128 || !isprint(ev.key.keysym.sym))
if (block_text || ev.key.keysym.sym < 0 || ev.key.keysym.sym > 128) {
sdl_add_key(sdl_get_char_code(ev.key.keysym.sym, ev.key.keysym.mod));
}
else if (!isprint(ev.key.keysym.sym)) {
uint8_t ch = cpchar_from_unicode_cpoint(getcodepage(), ev.key.keysym.sym, 0);
if (ch)
sdl_add_key(ch);
}
break;
case SDL_TEXTINPUT:
if (!block_text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment