检查是否同时按下了两个键

编程入门 行业动态 更新时间:2024-10-26 16:33:22
本文介绍了检查是否同时按下了两个键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我想在基于MFC对话框的应用程序中检查如何检查 A + 1 B + 1 键是否被按下.我正在使用PreTranslateMessage(MSG * pMsg)函数检查按键,但是我不知道该怎么做按键组合.寻求帮助!

Hi, i want to check in my MFC dialog based application how to check if A + 1 or B + 1 keys are being pressed. I''m using PreTranslateMessage(MSG* pMsg) function to check keys but i don''t know what to do for key combination. Thx for help!

推荐答案

看看 GetAsyncKeyState [ ^ ]或 GetKeyState [^ ] 该组合永远不会存储在您的MSG结构中.因此,如果以上内容不适合您,您将不得不查找两条消息,一条消息传递给A,一条消息传递给1. Have a look at GetAsyncKeyState[^] or GetKeyState[^] The combination is never stored in your MSG struct. So if the above doesn''t cut it for you, you will have to look for two messages, one for A and one for 1.

更多推荐

检查是否同时按下了两个键

本文发布于:2023-11-08 13:26:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569493.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按下   两个

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!