如何知道在键盘上按下了Ctrl + F? [英] How to know Ctrl + F is pressed on Keyboard?

查看:305
本文介绍了如何知道在键盘上按下了Ctrl + F?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我具有的功能:

Here is the function i have:

BOOL cDlgGrid::PreTranslateMessage(MSG* pMsg) 
{ 
    if (WM_KEYFIRST <= pMsg->message && 
        pMsg->message <= WM_KEYLAST) 
    { 
        HACCEL hAccel = m_hAccel; 
        if (hAccel && 
			::TranslateAccelerator(m_hWnd, hAccel, pMsg)) 
            return TRUE; 
    } 
    if (pMsg->message==WM_KEYDOWN && pMsg->wParam == VK_CONTROL)
    {
         OnFind(); // implements and find dialog
    }
    return CDialog::PreTranslateMessage(pMsg); 
};



根据代码,我知道如何捕获Ctrl键,现在我如何知道是否按了Ctrl + F,我想实现Ctrl + F的查找对话框,而不仅仅是Ctrl.我该如何实现呢?



According to the code, i know how to capture the Ctrl key press, now how do i know if Ctrl+F is pressed, i want to implement the find dialog for Ctrl+F not for just Ctrl. How do i achieve this?

推荐答案

看看以下主题
GetAsyncKeyState [ WM_HOTKEY [键盘输入 [
take a look at the following topics
GetAsyncKeyState[^]
WM_HOTKEY[^]

Keyboard Input[^]


这篇关于如何知道在键盘上按下了Ctrl + F?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆