How to use the C++ HARDWARE_INPUT structure?

Asked

Viewed 56 times

1

I am developing a program that simulates inputs for games. Using the function SendInput() C++. I’ve already been able to simulate keyboard inputs from the structure INPUT using the parameter INPUT_KEYBOARD, however I do not know how to use the parameter INPUT_HARDWARE to simulate an Xbox controller, for example. I’m using the library <Windows.h>. Here are some links I’m using as a reference:

HARDWAREINPUT Structure: https://msdn.microsoft.com/pt-br/library/windows/desktop/ms646269(v=vs.85). aspx

INPUT Structure: https://msdn.microsoft.com/pt-br/library/windows/desktop/ms646270(v=vs.85). aspx

  • I suggest improving the quality of your question to get better answers. For example, code your application. Learn more about MCVE.

  • 1

    I didn’t put the code in because I haven’t written it yet, I don’t know how to use this structure.

  • For all I know it’s possible to do what you want using C#. You can have a look at this emulator and its source http://www.x360ce.com/ https://github.com/x360ce/x360ce

  • by what the documentation says you can only simulate true hardware events for mouse and keyboard (or something the system sees as mouuse and keyboard, e.g. typing on a touch screen counts with keyboard, one tap on a touch screen counts as mouse)...the HARDWAREINPUT structure apparently serves to simulate a non-existent, virtual hardware.... ps: take off the C++ tag because it has nothing to do with C++

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.