Why do I get two messages on AltGr being pressed?
I have the following hook:
LRESULT CALLBACK MyClass::KeyboardShotcutsHook(int code, WPARAM wParam, LPARAM lParam)
When in polish language I press AltGR+Key
(right Alt) it produces 2 messages:
- Ctrl+
Key
- Alt+Ctrl+
Key
Why? and how to avoid Ctrl+Key
?
Because AltGr and Alt+Ctrl are equivalent (in Windows). Two key stroke sequences mean the same thing, and Alt+Ctrl won (probably because there is no AltGr on the US keyboard layout - that's my guess).
If you want to check for AltGr, check if Ctrl is pressed whenever Alt shows up in your hook.