473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to send keyboard commands to a game based on Direct-X or OpenGL

Hi all,

First i m clearing one thing. This question is a general windows question and it has nothing to do with programming.

I want to know that how can i send keyboard commands to a game based on Direct-X or OpenGL.
I have tried SendInput and keybd_event API to send keyboard commands but it aint working on games but working perfectly on normal windows form based applications. Sending messages to a game aint work, because direct input ignores windows messages, it communicated directly with the device drivers. Please Please just tell me any way to send keyboard keys and mouse events to a game. Again only the way i m not much interested in code, but code ll be appreciated.

Example Scenario: I m playing Need For Speed. Now my application will send it a key which is key Up, and car ll be accelerated. These commands will be sent from some kind of form based application.

Please tell me any way or any technique to do this.

Thanks a lot in advance to the readers and to those who will answer to this post.

PS: I have googled for 3-4 hours to find the answer of this question SO please dont suggest me to google about it first. Thank you.
Nov 7 '10 #1
3 3755
Death Slaught
1,137 1GB
If it's something like NFS, in short, you can't. The game detects your mouse clicks or when keys are pressed, and fires a lot of commands/scripts accordingly. To send the correct commands/scripts based on input to the game would require access and extensive knowledge of the game engine. Even then you would need a program that can run the commands/scripts while NFS is running.


Regards, Death
Nov 10 '10 #2
thanx death slaught...
Sorry i cant check my post because i found dat i have to hook direct input...
Nov 14 '10 #3
NeoPa
32,556 Expert Mod 16PB
A new (hijack) post was added in here and has since been moved to the Lounge, which is a members-only area, as Hello Bytes.
Nov 15 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: me | last post by:
Hey all, I am making a 4 in a row game in flash MX. Wel i do it a bit pimitief like sending respons from the swf file to the php-mysql handler to see if the other user has make a move. I...
2
by: lehmann | last post by:
Hello, Is it possible to have a disabled input in a form whose value could be sent when the form is submitted. I just need the user not to be able to change the input value, but this value is...
6
by: Kartik | last post by:
Hello, I was trying to develop a game in c++ ( text mode ), but I couldn't figure out how to make rest of the elements moving in the game while waiting for the player's input, or, how to accept...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
6
by: Brian Basquille | last post by:
Hello all. Due to the short time remaining to my project handup for my Air Hockey game, i've abandoned the idea of implementing it over a network. But since the only real way to play Air...
3
by: noballack | last post by:
I've got a problem, I'm working with Ajax in a web with a form with a list of checkbox added to the form via an Ajax.Updater method. These added checkboxs are not been sended by the form if I use...
5
by: colin | last post by:
Hi, Ive got a 3d model editor wich im developing with XNA c# development environment, using the game window to display the wireframe mesh in 3d. however I need to use some other windows too,...
2
by: tesa | last post by:
I am not able to figure out how to make this work. I am trying to create a hangman game. I am in a basic javascripting class. I am to only use very basic code as you can see. I am able to use any...
4
by: George Oliver | last post by:
hi, I'm a novice programmer trying to better define a hobby project I'm thinking of. What I would like to do is take a program and embed it or put it within a Python-run GUI, using the GUI just...
2
by: LilMeechc20 | last post by:
Hello, I have a group assignment that I have to do. We have to write a Tic Tac Toe game. One person in my group has managed to write the code for a multiplayer (human -vs- human) game and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.