| Summary: | ALT+TAB on Windows 7 with Aero theme doesn't release ALT key modifier state | ||
|---|---|---|---|
| Product: | SDL | Reporter: | buckyballreaction |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Windows 7 | ||
This bug appears to be gone as of hg rev 53df899db00b |
On Windows 7 with an Aero theme enabled, if you ALT+TAB out of an SDL2 application, the ALT modifier state (KMOD_LALT is what I used) stays on. Upon focus gain, (SDL_GetModState() & KMOD_ALT) will always return true. This is problematic if you wish to capture the ALT key in the application for some purpose (ALT + ENTER to resize), because it thinks the ALT key is already pressed and you may cause an undesired action. The workaround is to do something like this in the even loop: case SDL_WINDOWEVENT_FOCUS_LOST: SDL_SetModState(KMOD_NONE); break; This does not occur on Windows XP, or Windows 7 with Aero turned off.