473,624 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2799
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.hel sinki.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
11253
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 type=text ...> object. focus() sets the cusor at the beginning Any idea ? Christian.
2
2230
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. This works fine. Unfortunately some persons fill in their e-mail address instead of the URL of their page. Checking is done on empty fields but how to avoid
0
1389
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 command line area of the page properties of this file I have included the next code: mkdir $(ProjectDir)..\bin\$(OutDir)\es-ES al.exe /culture:es-ES /out:"$(ProjectDir)..\bin\$(OutDir)\es-ES\Resource_Example.resources.dll" ...
2
1146
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 I want to know if it is possible to pass the parent form to my contol and process keypresses inside my contol, without coding my contols logic in the main form ?
1
1526
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 particular sentence in 1 of 3 languages depending on the language of the visitor (this sentence would be in Spanish or Italian or German and the rest of the page in English). I have found this code to detect the language:
3
1924
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: ====== if(!$dbh->query($sql)->fetchColumn()) { try { //Expects two parameters -won't run
23
2126
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 it waits for the 1st kedit to be closed before it opens the second #include <stdio.h> #include <stdlib.h> int main()
15
4215
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 testing for support of particular eventTypes - the DOM 2 Events Interface DocumentEvent says that if the eventType is not supported, it throws a DOM exception. This makes testing rather tough - if you try something like: if (document &&...
0
8231
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8614
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8471
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6107
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.