The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
Key press blocks mouse motion event in windows
Avenger
Joined: 17 Jul 2014
Posts: 1
Posted: Fri Jul 18, 2014 8:40 am
Hello.
I'm having an issue with the SDL_MOUSEMOTION event when running on Windows with SDL 2.0.3. The mouse motion event works great on its own, but if I hold a key down on the keyboard the mouse motion event is not sent.
This is my event handling loop, inside my render loop:
case SDL_KEYDOWN:
case SDL_KEYUP:
Logger::log("Key event");
break;
case SDL_MOUSEMOTION:
Logger::log("mouse motion");
break;
case SDL_QUIT:
done = true;
break;
}
}
render();
}
On linux, this works great, I can see multiple mouse motion events while holding a key down, together with a repetition of the key event some times pr second.
In windows however, all I get is the key event if a key is down. I get mouse motion events up until I press a key, and after 1 second or so after the key is released, but in the middle of that I only get key events.
I can mention that I have enabled relative mouse motion with SDL_SetRelativeMouseMode(SDL_TRUE).