Skip to content
Snippets Groups Projects
Commit 6582f296 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Don't treat numpad /*-+ differently based on NumLock in SDL

This caused double-keys on those when numlock was off.  Only the
number keys and period need special NumLock handling.

Fixes bug 108 on SourceForge, thanks nelgin!
parent f7a2fd72
No related branches found
No related tags found
No related merge requests found
......@@ -960,12 +960,12 @@ void sdl_video_event_thread(void *data)
block_text = 1;
if (block_text || ev.key.keysym.sym < 0 || ev.key.keysym.sym > 127) {
// NUMLOCK makes
if ((ev.key.keysym.mod & KMOD_NUM) && ((ev.key.keysym.sym >= SDLK_KP_1 && ev.key.keysym.sym <= SDLK_KP_0)
|| ev.key.keysym.sym == SDLK_KP_DIVIDE
if (ev.key.keysym.sym == SDLK_KP_DIVIDE
|| ev.key.keysym.sym == SDLK_KP_MULTIPLY
|| ev.key.keysym.sym == SDLK_KP_MINUS
|| ev.key.keysym.sym == SDLK_KP_PLUS
|| ev.key.keysym.sym == SDLK_KP_PERIOD))
|| ev.key.keysym.sym == SDLK_KP_PLUS)
break;
if ((ev.key.keysym.mod & KMOD_NUM) && ((ev.key.keysym.sym >= SDLK_KP_1 && ev.key.keysym.sym <= SDLK_KP_0) || (ev.key.keysym.sym == SDLK_KP_PERIOD)))
break;
sdl_add_key_uc(sdl_get_char_code(ev.key.keysym.sym, ev.key.keysym.mod), &cvstat);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment