How to detect if keystroke was emulated by keybd_event or SendInput?

。_饼干妹妹 提交于 2020-02-27 12:41:21

问题


Is it possible to detect in my custom Win32 control, while processing WM_CHAR, or WM_KEYDOWN message, whether the keystroke came from the actual keyboard, or was emulated by a call to SendInput or keybd_event type function?


回答1:


You could check if the LLKHF_INJECTED flag is set in a low-level hook. I don't think you can tell just by looking at the LPARAM.



来源:https://stackoverflow.com/questions/45008637/how-to-detect-if-keystroke-was-emulated-by-keybd-event-or-sendinput

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