5

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~

6
  • That's always worked for me, but you might need a keyboard driver or something then. Commented May 12, 2013 at 5:16
  • Could you tell me what kind of application are you using SendInput() for? Commented May 12, 2013 at 6:01
  • If I understand correctly, you have two applications: 1 that receives IMU tracking data and forwards it as keyboard events, and 1 that receives keyboard input and translates it as commands in a flash game. Did you try manually sending keyboard events, WM_KEYDOWN, WM_KEYUP using the SendMessage function. Commented May 12, 2013 at 6:10
  • @Tianyu, I honestly can't remember. I don't need to simulate input very often. Commented May 12, 2013 at 6:13
  • @BenjyKessler, your understanding is correct. Sorry for not explaining my problem clearly. But you get the point. I haven't tried SendMessage(), which could be a good and intuitive way to do that. For my understanding, it should be working because running a flash game rather than a huge game engine like NEED FOR SPEED will no block keyboard input stream or require lower level keyboard input. I will try SendMessage() first and I sincerely hope I will not turn into using WDK at the very end. Thanks~I will let you know how it works out. Commented May 12, 2013 at 6:29

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I think you are right about developing a HID compliant device on a hardware level. Also virtual driver is also an option. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.