关于使用ctrl的快捷键的问题 [英] Question about shortcut key with ctrl

查看:78
本文介绍了关于使用ctrl的快捷键的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个关于ctrl键的问题,现在我创建了一个vc演示,我使用快捷键O将工具栏更改为Ooobal,如果弹出了主菜单视图,则按o小键盘就会响应或Ctrl + O组合小键盘,并且在文件主菜单中使用了ctrl + o,如果不使用,则不响应按ctrl + o.现在,即使其他子菜单项中使用了ctrl + o,我也只希望o字母具有响应,而不是ctrl + o.
Windows默认演示都是这样,我发现foxit阅读器不喜欢这样,没关系.我要他们怎么做?

有人听懂吗?如果您知道,请回答问题.
非常感谢您.

Hey , everyone, I have a question about ctrl key, now I created a vc demo, i changed Toolbar to Ooobal with shortcut key O, if the view main-menu has pop up, it will response either you press o keypad or Ctrl+O combination keypad, and the ctrl+o is used in file main-menu, if not used, press ctrl+o is not responsed. Now, I want only o letter has a response, not ctrl+o, even if the ctrl+o is used in other sub-menu item.
The windows default demo all like this, I found that the foxit reader did not like this, it’s OK. I want how they did it?

Anyone understand it? If u know, please reply the questions.
thank you very much

推荐答案

默认情况下,像A到Z这样的默认普通"键不会打开菜单,它们会键入字符.这就是为什么存在像CTRL和ALT这样的修饰键的原因-这样应用程序就可以知道用户正在尝试做什么.

如果您成功地颠覆了这一点,那么您在实践中所要做的就是烦扰您的用户.

不要这样做,这是一个愚蠢的主意.改为按CTRL +键或ALT +键组合.
By default "Normal" keys like A to Z do not open menus, they type characters. That is why the modifier keys like CTRL and ALT exist - so that applications can tell what the user is trying to do.

If you did successfully subvert this, all you would do in practice is annoy the heck out of your users.

Do not do this, it is a stupid idea. Stick to CTRL+key or ALT+key combinations instead.


hi,OriginalGriff,
客户只希望将普通"键用作快捷键,而不希望将CTRL键用作服务快捷键,正如我提到的那样, foxit阅读器 软件可以支持此功能.我在mainfrm :: PreTranslateMessage中捕获了WM_COMMAND消息,获得了顶层菜单ID,将模拟鼠标的左键单击,但是没有响应,代码如下,

OriginalGriff,
The customer want only "Normal" keys as short-key separately, not with CTRL key for serval short-keys, as my mentioned, The foxit reader software can support this. I capture WM_COMMAND message in mainfrm::PreTranslateMessage, get the top-level menu id, gonna simulate left-clicking of the mouse ,but has no respose, the codes as belows,

if (pMsg->message == WM_COMMAND)
    {
        if (ID_ZOOMIN == LOWORD(pMsg->wParam))
        {
            if (::GetKeyState(VK_CONTROL) < 0)
            {
                if (m_pMainMenu)
                {
                    UINT n = m_pMainMenu->gt;GetMenuItemID(1);
                    ::SendMessage((HWND)m_pMainMenu->GetSubMenu(1)->gt,GetSafeHmenu(),WM_COMMAND,MAKEWPARAM(0, m_pMainMenu->GetMenuItemID(1)),0);

                }

                return TRUE;
            }
        }


    }




ID_ZOOMIN是快捷键为"O"的子菜单ID.现在,之前的代码可以禁止ctrl + o键盘,但是如果按ctrl + o,则该子菜单消失了,失去了焦点.我正在寻找原因.
OriginalGriff或任何男孩都可以告诉我完成此小功能的原因或其他方法吗?

谢谢,
等待回复




the ID_ZOOMIN is the sub-menu ID which short-key is "O". Now the before codes can forbid the ctrl+o keypad, but if press ctrl+o, this sub-menu has disappeared, lost focus. I am finding the reason.
Could OriginalGriff or anyboy tell me the reason or the other approach to finish this little funtion?

thanks,
waiting the reply


这篇关于关于使用ctrl的快捷键的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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