Right Alt key also triggers Windows Message for Left Control key
In a win32 message handler I'd like to be able to handle Left and Right Alt and Control keys. Left and Right is distinguished with bit 24 of lParam, but when I press the Right Alt then I also get a message 开发者_开发知识库for Left Control key (Right Alt is therefore "alt gr"). Is there a way to switch off this behavior or somehow distinguish the message for the Left Control key that was triggered by the Right Alt key?
I just hit this issue and found that Keyboard Language had United States-International keyboard selected. Switching that fixed the issue.
I figured it out thanks to Dell - Right Alt click does not work
Read about reading the keyboard states using Msdn GetKeyState
Then call GetKeyState()
and use the VK
of VK_LSHIFT
VK_RSHIFT
VK_LCONTROL
VK_RCONTROL
VK_LMENU
VK_RMENU
to see if it is pressed or not.
精彩评论