Block keystrokes from a specific keyboard

风流意气都作罢 提交于 2019-12-10 23:47:11

问题


I would like to block all keystrokes that are coming from a specific keyboard (identified by its HID/Name, so its low level stuff I guess) before they reach the focused application. But I'm still using this disabled keyboard (I'm getting the keystrokes). I think I need an application's hook but I don't know how to do that. Maybe you can give me some useful link?

Regards,

EDIT:

I think I need a low-level hook, because general hook (I mean hook all the existing window & threads) aren't available in the .net framework, concerning the user-space. Moreover, I use RAWINPUT to get typed keystrokes from the keyboard. So if I make a hook to block keystroke from a specific device, could the hook block the RAWINPUT as well?


回答1:


An application can distinguish the source of the input by getting raw input data. However the application needs to handle WM_INPUT instead of WM_CHAR, WM_MOUSEMOVE, or WM_APPCOMMAND.



来源:https://stackoverflow.com/questions/12885897/block-keystrokes-from-a-specific-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!