开发者

Right Alt key also triggers Windows Message for Left Control key

开发者 https://www.devze.com 2023-03-28 11:50 出处:网络
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 m

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.

Right Alt key also triggers Windows Message for Left Control key

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消