为什么在按下"AltGr"时会收到两条消息? [英] Why do I get two messages on `AltGr` being pressed?
本文介绍了为什么在按下"AltGr"时会收到两条消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么在按下 AltGr 时会收到两条消息?
Why do I get two messages on AltGr being pressed?
我有以下钩子:
LRESULT CALLBACK MyClass::KeyboardShotcutsHook(int code, WPARAM wParam, LPARAM lParam)
当以波兰语输入时,按 AltGR + Key
(右Alt )会产生2条消息:
When in polish language I press AltGR+Key
(right Alt) it produces 2 messages:
- Ctrl +
Key
- Alt + Ctrl +
Key
- Ctrl+
Key
- Alt+Ctrl+
Key
为什么?以及如何避免 Ctrl + Key
?
Why? and how to avoid Ctrl+Key
?
推荐答案
因为AltGr和Alt + Ctrl是等效的(在Windows中).两个击键序列表示同一件事,Alt + Ctrl获胜(可能是因为美国键盘布局上没有AltGr,这是我的猜测).
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).
如果要检查AltGr,请检查在钩子中出现Alt时是否按下Ctrl.
If you want to check for AltGr, check if Ctrl is pressed whenever Alt shows up in your hook.
这篇关于为什么在按下"AltGr"时会收到两条消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文