Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sending keystrokes to DirectX applications.

Posted on 2004-08-19
5
Medium Priority
?
646 Views
Last Modified: 2008-03-03
I need a way to send keystrokes to a DirectX (3.0+) application.  I've tried Sendkeys, as well as the keybd_event API, no luck, the keystrokes never arrive.

Anyone know?
0
Comment
Question by:fizycist
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 11852514
Hmm, I would guess it is using DirectInput, from MSDN
"Microsoft DirectInput Overview
Apart from providing services for devices not supported by the Microsoft Win32 API, Microsoft DirectInput gives faster access to input data by communicating directly with the hardware drivers rather than relying on Microsoft Windows messages."
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 11852705
You might try using the On-Screen keyboard (Under Accessories --> Accessibility)  If you can drive it with On-Screen Keyboard, there is some way to drive it programatically.
0
 

Author Comment

by:fizycist
ID: 11856785
Ok, I tried on screen keyboard.  This game will accept some keystrokes from it, not all.  The keystrokes for movement are not accepted, and these are the ones I need.  I tried remapping the keys in the game, but no luck.

So can I slip keystrokes in with DirectInput?  How?

(btw this is for a neural network demonstration, the goal is to teach a NN to play this simple game (Subspace / Contiuum.  The software can already read the screen and identify objects, but simply cannot act on its decisions, arghh)
0
 
LVL 16

Accepted Solution

by:
JohnBPrice earned 520 total points
ID: 11901808
I think slipping keystrokes in to DirectInput might be tough.  DirectInput gives the app direct access to the keyboard driver, nothing in Windows interferes while the app is the active app.  Some ideas would be to find a keyboard driver that supports this kind of thing (I don't know if they exist), buy/make a hardware device to slip in between your real keyboard and the computer (the home built flight simulator guys seem to have some experience here, search for keyboard eumulator simulator), maybe you could hook into the calls to DirectInput, catch when they try to capture the keyboard, and thus find their input routine which you could fake key presses into.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question