| Summary: | [PATCH] Implement keyboard grab support for Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Cameron Gutman <cameron.gutman> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: |
Patch
Patch v2 |
||
|
Description
Cameron Gutman
2021-01-23 01:52:24 UTC
Created attachment 4692 [details]
Patch
Created attachment 4693 [details]
Patch v2
It turns out Windows provides a nice API to do the address->HMODULE lookup for us, so it's trivial to support both static and dynamic linked versions of SDL (and those who use don't use the default name of SDL2.dll for their DLL).
Patch added, thanks! https://hg.libsdl.org/SDL/rev/3f700918b9f6 It might need some tweaking for XP support. I haven't checked the functions you call to see if they're supported there. It should be okay on XP. The hooking APIs are documented as W2K+ and GetModuleHandleEx() is XP+. I'll try it though. It works on XP. Capture of Alt+Tab doesn't work prior to Windows 8 for some reason, but all the Super key combos seem to be captured properly. |