有没有办法检测rawinput(真正的物理击键)并忽略SendINput [英] Is there any way to detect rawinput (real physical keystrokes) and ignore SendINput

查看:83
本文介绍了有没有办法检测rawinput(真正的物理击键)并忽略SendINput的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C中寻找方法/脚本来检测真实的物理击键。我不想使用SendInput(或任何其他模拟器输入)。



如果可能的话,只有没有SendInput的RAWINPUT数据才是好的。

I am looking for way/script in C to detect real physical keystroke. I don't want to use SendInput (or any other simulator input).

If possible, it would be good only to have RAWINPUT data without SendInput.

推荐答案

正常方法是覆盖 PreTranslateMessage 并检查这些值。



在这个来自Microsoft的网页是另一个很好解释的方法并且还可以找到一些示例代码。



提示:如果您处理击键,则返回并且不处理默认值。
The normal way is to overwrite PreTranslateMessage and check for these values.

In this webpage from Microsoft is another approach well explained and also some sample code can be found.

Tip: If you handle the keystroke make a return and not handling to the default .


这篇关于有没有办法检测rawinput(真正的物理击键)并忽略SendINput的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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