Game programming

Moderators: None (Apply to moderate this forum)
Number of threads: 2070
Number of posts: 5361

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Heeelp! Need Keyboard Input Help....(multiple keypresses) Posted by neurosy on 14 Jun 2001 at 5:01 AM
I am working on a two-player, split screen game that is very keyboard intensive. Both players control their respective character via keyboard input. The character control is very fluid, but requires that the user hold down two or more keys (such as the 'up' AND 'left' keys to move in a diagonal direction. The problem is, I can not get the program to register more than three simultaneous keypresses. If player one is moving diagonally, then player two can only move up, down, left, or right as the fourth keypress does not register. If player one moves diagonally AND fires guns then player two cannot move at all! I am currently using the GetAsyncKeyState() API function inside of a do...while game loop. The players each have their own small form, which are child forms in an MDI. Please, please help as the game is complete except for this control issue. It pains me to not be able to share my game w/ family and friends because of this one little issue! I thank you in advance for your time and consideration on this problem!

thomas
sebek12345@aol.com
www.neurosy.com

Report
Re: Heeelp! Need Keyboard Input Help....(multiple keypresses) Posted by Amante on 19 Jun 2001 at 3:02 AM
: I am working on a two-player, split screen game that is very keyboard intensive. Both players control their respective character via keyboard input. The character control is very fluid, but requires that the user hold down two or more keys (such as the 'up' AND 'left' keys to move in a diagonal direction. The problem is, I can not get the program to register more than three simultaneous keypresses. If player one is moving diagonally, then player two can only move up, down, left, or right as the fourth keypress does not register. If player one moves diagonally AND fires guns then player two cannot move at all! I am currently using the GetAsyncKeyState() API function inside of a do...while game loop. The players each have their own small form, which are child forms in an MDI. Please, please help as the game is complete except for this control issue. It pains me to not be able to share my game w/ family and friends because of this one little issue! I thank you in advance for your time and consideration on this problem!
:
: thomas
: sebek12345@aol.com
: www.neurosy.com
:


Report
Re: Heeelp! Need Keyboard Input Help....(multiple keypresses) Posted by Amante on 19 Jun 2001 at 3:07 AM
Once there was a game called StarControl, and i also remmber it have this problem.
It's called KeyBoard - Jam, in any keyboard it's diffrent.
After pressing some keys , and keep them pressed, messages of pressing other keys are not passed. But some times there are still keys that do pass the messages. Like if you keep keys 1,2,3,4,5 pressed, you will not get the key 6 message, but you will get ' key pressed, or so.
You just need to find the keys that do work.
StarControl had a program to find those key jamming.

Don.

: I am working on a two-player, split screen game that is very keyboard intensive. Both players control their respective character via keyboard input. The character control is very fluid, but requires that the user hold down two or more keys (such as the 'up' AND 'left' keys to move in a diagonal direction. The problem is, I can not get the program to register more than three simultaneous keypresses. If player one is moving diagonally, then player two can only move up, down, left, or right as the fourth keypress does not register. If player one moves diagonally AND fires guns then player two cannot move at all! I am currently using the GetAsyncKeyState() API function inside of a do...while game loop. The players each have their own small form, which are child forms in an MDI. Please, please help as the game is complete except for this control issue. It pains me to not be able to share my game w/ family and friends because of this one little issue! I thank you in advance for your time and consideration on this problem!
:
: thomas
: sebek12345@aol.com
: www.neurosy.com
:


Report
Re: Heeelp! Need Keyboard Input Help....(multiple keypresses) Posted by neurosy on 19 Jun 2001 at 3:18 AM
Don,
Thank you much for your kind response and most excellent input. I have discovered that there is an inconsistency insofar as some keys are blocked while others are not. A most perplexing, but nonetheless interesting, dilemma. I will try to find StarControl and see if their program is of any use. I think my only reservation might be that perhaps the key combinations are also different for each keyboard - wouldn't that be fun! LOL. I have exhausted all other options here, so I will certainly pursue your lead. Thanx again!


: Once there was a game called StarControl, and i also remmber it have this problem.
: It's called KeyBoard - Jam, in any keyboard it's diffrent.
: After pressing some keys , and keep them pressed, messages of pressing other keys are not passed. But some times there are still keys that do pass the messages. Like if you keep keys 1,2,3,4,5 pressed, you will not get the key 6 message, but you will get ' key pressed, or so.
: You just need to find the keys that do work.
: StarControl had a program to find those key jamming.
:
: Don.




Report
Re: Heeelp! Need Keyboard Input Help....(multiple keypresses) Posted by Machaira on 2 Jul 2001 at 7:08 AM
You might want to look at DirectInput. Using the API for keyboard handling is problematic at best when trying to capture multiple keys pressed at the same time.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.