在WinForms MDI中无法捕获Ctrl + Alt + F1.有什么特别的吗? [英] Cannot catch Ctrl+Alt+F1 in WinForms MDI. Is it special?

查看:79
本文介绍了在WinForms MDI中无法捕获Ctrl + Alt + F1.有什么特别的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WinForms MDI应用程序在 ToolStripMeniItem 项目中设置了多个键盘快捷键.

My WinForms MDI application has several keyboard shortcuts set at ToolStripMeniItem items.

以下其中之一:

  • Ctrl + Alt + F1
  • Ctrl + Alt + F2
  • Ctrl + Alt + F3
  • Ctrl+Alt+F1
  • Ctrl+Alt+F2
  • Ctrl+Alt+F3

第一个永远不会触发其菜单项.其他人按预期工作.

the first one is never triggering its menu item. Others work as expected.

  • 它是否在某处被阻止/使用?是否有一些此类被阻止的键盘快捷键的列表?

  • Is it somewhere blocked/used? Is there some list of such blocked keyboard shortcuts?

有没有一种使用方法? (最好仅通过设计器而不添加特殊代码?)

Is there a way how to use it? (Preferably just via designer without adding special code?)

推荐答案

如果我在计算机上按Ctrl + Alt + F1,则它将激活英特尔高清图形控制面板".英特尔是许多计算机上已经预装的无用恶意软件的非常广泛传播的一部分,英特尔对其软件非常不负责任.当我使用任务管理器(HK =热键)终止igfxHK.exe进程时,那么MDI应用程序中的此代码可以正常工作:

If I press Ctrl+Alt+F1 on my machine then it activates the "Intel HD Graphics Control Panel". A pretty well spread piece of useless malware that many machines have pre-installed, Intel is very irresponsible with their software. When I kill the igfxHK.exe process with Task Manager (HK = Hot Key) then this code in a MDI app works fine:

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
        Console.WriteLine((int)keyData);
        if (keyData == (Keys.F1 | Keys.Control | Keys.Alt)) {
            MessageBox.Show("Yada");
            return true;
        }
        return base.ProcessCmdKey(ref msg, keyData);
    }

我将为您保留"Yada"屏幕截图.否则,一个非常典型的危险就是,调用RegisterHotKey()的程序将始终领先于您的快捷键击,并执行应做的任何事情.语言栏跳到另一个.还有很多其他的.使用任务管理器杀死进程以找到邪恶的人.

I'll spare you the "Yada" screenshot. Otherwise a pretty typical hazard, programs that call RegisterHotKey() always get ahead of your shortcut keystroke and do whatever they are supposed to do. The Language Bar jumps to mind as another one. There are many others. Kill processes with Task Manager to find the evil-doer.

当然,您对此无能为力.您可以运行msconfig.exe禁用它,但这对您的用户的计算机没有任何帮助.这些程序总是选择明显的键,您可以通过从右到左选择快捷键来抵消它们.最好的办法是避免需要多个修饰符的键,用户也不喜欢它们.

Not much you can do about it of course. You can run msconfig.exe to disable it but that doesn't do anything useful for your user's machine. These programs invariably pick the obvious keys, you could counteract by picking your shortcut keys from right to left. Best thing is to avoid keys that require more than one modifier, a user doesn't like them either.

这篇关于在WinForms MDI中无法捕获Ctrl + Alt + F1.有什么特别的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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