473,396 Members | 1,996 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,396 software developers and data experts.

Detecting multiple keypress(es) in C

Hello,

I am writing a game in C and for making it a 2 player game, I need to
detect 2 or more keys getting pressed simultaneouly from the keyboard.

My knowledge of C / C++ is pretty intermediate and I would appreciate
any help.

Thanks in advance.

Regards,
Saurabh Jain
Nov 14 '05 #1
2 2788
Saurabh Jain <sa******@gmail.com> scribbled the following:
Hello, I am writing a game in C and for making it a 2 player game, I need to
detect 2 or more keys getting pressed simultaneouly from the keyboard. My knowledge of C / C++ is pretty intermediate and I would appreciate
any help.


This can't be done in ISO standard C or ISO standard C++, as neither
language specifies any way to read anything from the keyboard. You
should ask in a newsgroup dedicated to your own implementation.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don't feed it!"
- Anon
Nov 14 '05 #2
Saurabh Jain wrote:
Hello,

I am writing a game in C and for making it a 2 player game, I need to
detect 2 or more keys getting pressed simultaneouly from the keyboard.

My knowledge of C / C++ is pretty intermediate and I would appreciate
any help.

Thanks in advance.

Regards,
Saurabh Jain

This is more specific to the windowing toolkit that you are using
instead of C/C++ .

--
Karthik.
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christian | last post by:
Hello, As the subject says it, is there a way to simulate a special keypress in JS ? In my case, on loading an HTML page, i'd like to set the cursor at the end of the input text of an <input...
2
by: Frank | last post by:
Hello, I'm a total newbie on Javascript, and with a lot of help and some copy and paste managed to get things running. On my site: http://home.wanadoo.nl/homepage I use a form from Bravenet....
0
by: amartos | last post by:
Hi, I am trying to create a dll file from several resources files. I am using visual studio .net and I have a c++ project which has included a file called "Resource.es-ES.resources", in the...
2
by: Peter Osawa | last post by:
Hi, I'm making a form with a statusbar. I added a custom control to statusbar (That control has only a textbox). I set KeyPreview to True on the form. Now I can monitor all keys pressed, but...
1
by: mouton | last post by:
Hello, I am a beginner. My website has 2 pages: one in English and one in French. I would like non English people to be directed to the English page. There I would like to display a...
3
by: Gilles Ganault | last post by:
Hello One of my PHP5 scripts wouldn't run right because I didn't use the right number of parameters in the SQL command, but PHP didn't return any error, even after adding a try/catch section: ...
23
by: student.matt | last post by:
ok i am trying to solve this little problem i have my program waits for the 1st system() call to finish before starting the next i will just throw an example of what i mean out in this example...
15
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.