| Summary: | Modifier key state incorrect when switching spaces on OS X | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Vern Jensen <vern> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P1 | CC: | icculus |
| Version: | HG 2.0 | Keywords: | target-2.0.0 |
| Hardware: | x86 | ||
| OS: | Mac OS X 10.6 | ||
|
Description
Vern Jensen
2011-05-24 10:15:16 UTC
Additional note: if I push any modifier key upon returning to the SDL app, such as "control", I'll instantly get both a keyDown event for control AND a keyUp event for command, even though command was released long before. So something about pushing a different modifier key gets SDL to "recognize" that command is no longer held down. Additionally, calling SDL_PumpEvents() in response to a SDL_WINDOWEVENT_FOCUS_GAINED event does not help. The user must push a modifier key to "fix" the problem. I discovered SDL_SetModState in the documentation. For now, manually calling: SDL_SetModState(0); upon a window focus gained event seems to solve the problem. I'm not sure what to pass other than 0, since I couldn't find SDL_Mod in the headers or docs wiki, but 0 seems to work just fine. For now, this will let me work around the bug. (Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.0, Priority 1. This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. Either we fixed this at some point, or Mac OS X 10.8 fixed it: the window loses focus when switching spaces with the hotkey, and the command key is reported in an SDL key-release event (and thus, the KMOD_GUI flag unsticks). Marking this fixed. --ryan. |