C#键盘按键检测优先级问题 [英] C# Keyboard Key detection precedence issue

查看:151
本文介绍了C#键盘按键检测优先级问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,可以检测C#winform上的按下键.问题是在客户端,还有一些其他应用程序也可以检测到被按下的按键并对其进行抑制,因此,我的应用程序表单无法获取有关被按下的按键的通知.我使用传统的form.KeyDown事件来检测密钥.与其他应用程序相比,我如何享有更高的优先级?

I have an application which detects pressed keys on C# winform. The problem is on client side there are some other applications which also detects the pressed keys and suppresses them and because of that my App's form does not get the notification for the pressed key. I have used traditional form.KeyDown event to detect the key. How can I take higher precedence than the other application?

推荐答案

如果您担心其他应用程序基本上会窃取您的按键,那么您需要研究包装器库.

If you're worried about other apps basically stealing your keystroke then you need to look into Global Hooks which is almost definitely how they other apps are stealing yours. You can roll your own code or use a wrapper library that someone else already wrote.

这篇关于C#键盘按键检测优先级问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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