0

How do I hook a xinput device to manipulate the inputs e.g. ignore all button presses except for a specific button?

Is it possible to hook the raw events so I can control any inputs through my code and any other application just sees what I allow?

cquests
  • 41
  • 2
  • You can hook raw input using the infrastructure provided by [Raw Input](https://learn.microsoft.com/en-us/windows/win32/inputdev/raw-input). To my knowledge, you cannot selectively suppress input events from a [WM_INPUT](https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-input) handler. – IInspectable Dec 05 '19 at 18:12
  • 1
    Another approach that seems a little complicated, use hook to intercept XInput's XInputGetState() and the 4 message retrieve functions in User32 (GetMessage and peek message and variants). Please refer [this](https://stackoverflow.com/questions/4507581/how-does-microsoft-detours-work-and-how-do-i-use-it-to-get-a-stack-trace). – Strive Sun Dec 06 '19 at 03:07
  • thank you very much @StriveSun-MSFT Unfortunately I can't upvote your comments yet – cquests Dec 06 '19 at 10:03
  • Has your problem been solved? – Strive Sun Dec 10 '19 at 08:58

0 Answers0