Fullscreen game does not respond to input simulator/kb_event

Oct 30, 2011 at 12:14 PM

Hey,

I've made a tool that sends keyboard events to a racing game so the user can drive using MS Kinect..

I can send keyboard events using kb_event from user32.dll and I got InputSimulator working as well. With desktop applications (such as notepad) everything works fine, but GTA: San Andreas is *the only* game that listens to my keyboard events. My question is: Why are other games (Need for Speed, Track Mania etc.) not responding to the events? And how do I need to create the keyboard events to get it working?

Coordinator
Oct 30, 2011 at 9:59 PM
Hi There,

From what I've heard, people often have issues getting flash games and other games to listen to input simulated with user32. At a guess I'd assume the game implementations may use a custom input stack. The other thing that can get in the way is UAC, where an application of lower elevation cannot send input to one of higher.

That's about all the info I can offer, sorry. Let me know if you figure it out. :)

Mike

On Sun, Oct 30, 2011 at 9:14 PM, thecake <notifications@codeplex.com> wrote:

From: thecake

Hey,

I've made a tool that sends keyboard events to a racing game so the user can drive using MS Kinect..

I can send keyboard events using kb_event from user32.dll and I got InputSimulator working as well. With desktop applications (such as notepad) everything works fine, but GTA: San Andreas is *the only* game that listens to my keyboard events. My question is: Why are other games (Need for Speed, Track Mania etc.) not responding to the events? And how do I need to create the keyboard events to get it working?

Read the full discussion online.

To add a post to this discussion, reply to this email (inputsimulator@discussions.codeplex.com)

To start a new discussion for this project, email inputsimulator@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Oct 31, 2011 at 6:09 PM
It seems like most games don’t listen to the Windows API, but to the keyboard/mouse/joystick/gamepad-events of DirectInput (DirectX/XNA), which are one level below.
The solution to my problem was to use SendInput with ScanCodes as a parameter like described here: http://stackoverflow.com/questions/3644881/simulating-keyboard-with-sendinput-api-in-directinput-applications
(It still took me the whole day, because scan-codes are really hard to get and depend on the keyboard language...)
I wonder why there’s no code out there ready to be copy-pasted :/
~theCake
From: [email removed]
Sent: Sunday, October 30, 2011 9:59 PM
To: [email removed]
Subject: Re: Fullscreen game does not respond to input simulator/kb_event [inputsimulator:277680]

From: michaelnoonan

Hi There,
From what I've heard, people often have issues getting flash games and other games to listen to input simulated with user32. At a guess I'd assume the game implementations may use a custom input stack. The other thing that can get in the way is UAC, where an application of lower elevation cannot send input to one of higher.
That's about all the info I can offer, sorry. Let me know if you figure it out. :)
Mike

On Sun, Oct 30, 2011 at 9:14 PM, thecake <notifications@codeplex.com> wrote:

From: thecake

Hey,

I've made a tool that sends keyboard events to a racing game so the user can drive using MS Kinect..

I can send keyboard events using kb_event from user32.dll and I got InputSimulator working as well. With desktop applications (such as notepad) everything works fine, but GTA: San Andreas is *the only* game that listens to my keyboard events. My question is: Why are other games (Need for Speed, Track Mania etc.) not responding to the events? And how do I need to create the keyboard events to get it working?

Read the full discussion online.

To add a post to this discussion, reply to this email (mailto:inputsimulator@discussions.codeplex.com?subject=[inputsimulator:277680])

To start a new discussion for this project, email inputsimulator@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Nov 1, 2011 at 3:47 AM
Glad you figure it out! :)

On Tue, Nov 1, 2011 at 3:09 AM, thecake <notifications@codeplex.com> wrote:

From: thecake

It seems like most games don’t listen to the Windows API, but to the keyboard/mouse/joystick/gamepad-events of DirectInput (DirectX/XNA), which are one level below.
The solution to my problem was to use SendInput with ScanCodes as a parameter like described here: http://stackoverflow.com/questions/3644881/simulating-keyboard-with-sendinput-api-in-directinput-applications
(It still took me the whole day, because scan-codes are really hard to get and depend on the keyboard language...)
I wonder why there’s no code out there ready to be copy-pasted :/
~theCake
From: [email removed]
Sent: Sunday, October 30, 2011 9:59 PM
To: [email removed]
Subject: Re: Fullscreen game does not respond to input simulator/kb_event [inputsimulator:277680]

From: michaelnoonan

Hi There,
From what I've heard, people often have issues getting flash games and other games to listen to input simulated with user32. At a guess I'd assume the game implementations may use a custom input stack. The other thing that can get in the way is UAC, where an application of lower elevation cannot send input to one of higher.
That's about all the info I can offer, sorry. Let me know if you figure it out. :)
Mike

On Sun, Oct 30, 2011 at 9:14 PM, thecake <notifications@codeplex.com> wrote:

From: thecake

Hey,

I've made a tool that sends keyboard events to a racing game so the user can drive using MS Kinect..

I can send keyboard events using kb_event from user32.dll and I got InputSimulator working as well. With desktop applications (such as notepad) everything works fine, but GTA: San Andreas is *the only* game that listens to my keyboard events. My question is: Why are other games (Need for Speed, Track Mania etc.) not responding to the events? And how do I need to create the keyboard events to get it working?

To add a post to this discussion, reply to this email (mailto:inputsimulator@discussions.codeplex.com?subject=[inputsimulator:277680])

To start a new discussion for this project, email inputsimulator@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Read the full discussion online.

To add a post to this discussion, reply to this email (inputsimulator@discussions.codeplex.com)

To start a new discussion for this project, email inputsimulator@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 16, 2013 at 8:07 PM
Hi!
I am also facing the same problem, I would appreciate if someone help me to send command to racing game.Code work fine with all application except game.

thanks in advance
Aug 16, 2013 at 10:30 PM
Hi ramesh,
I used this library: http://www.codeproject.com/Articles/117657/InputManager-library-Track-user-input-and-simulate
to do the DirectX-level keyboard input, which I now use in the application I demonstrated here: http://kuchenzeit.wordpress.com/2012/02/06/kindrive-enhanced-working-w-every-game-using-directx-input/ (with videos) - somewhere on my blog you should also find the sources of zhe KinDrive application in case you want to see how InputManager.dll is used.

best regards,
~michael