Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate keyboard input at system level in C++

Tags:

c++

winapi

I am trying to control games and do free tracking using an external IMU device here by simulating keyboard inputs like left and right arrows.

I have successfully done with calling SendInput() function in C++ to simulate pressing left and right arrow. However, it doesn't actually function in a game application (even for a small flash game.)

I searched on MSDN and found that SendInput() only works in the applications of the same integrity level. So is there a way to accomplish this keyboard input simulation at system level to pass around this integrity problem?

Thanks~

like image 987
Tianyu Avatar asked Nov 12 '22 05:11

Tianyu


1 Answers

Not a direct answer to your question, but an alternate suggestion.

Saitek (a manufacturer of big range of game devices) always uses virtual keyboard/mouse drivers to accomplish the same task. I'd suggest you do the same. OR you can make your device a HID-compliant one at hardware level, so it can emulate keyboard/mouse/joystick without any drivers.

like image 102
DarkWanderer Avatar answered Nov 15 '22 06:11

DarkWanderer