Detecting simulated keyboard/mouse input

前端 未结 3 1290
借酒劲吻你
借酒劲吻你 2020-12-10 23:30

Is there a way to detect simulated keyboard/mouse input on Windows. For example, a user types something on his keyboard vs sendKeys/PostMessage/On-screen keyboard. Is there

3条回答
  •  借酒劲吻你
    2020-12-10 23:58

    Starting form Windows 8 there's the GetCurrentInputMessageSource function. You can use it, and check the originId enum for the following value:

    IMO_INJECTED - The input message has been injected (through the SendInput function) by an application that doesn't have the UIAccess attribute set to TRUE in its manifest file.

提交回复
热议问题