PDA

Click to See Complete Forum and Search --> : Painful Keyboard question


Evil Techie
May 14th, 2002, 08:35 PM
im trying to make a game thats a 2 player sub shooting game

sub1 at 1 side and sub2 at another

keys are W,A,S,D for sub1
and up, down, left, right for sub2

the problem is, it wont work when u press 2 keys at the same time

it gotta reconize all keys simultaneosly

how????

please email me at davidh85@yahoo.com

thanx alot

Zaei
May 14th, 2002, 09:15 PM
Keep a list of all of the keys that are down at any one time, and react to that data, instead of direct KeyDown and KeyUp messages that come through your application.

Be aware, though, that most keyboards can only support at most 5 or 6 keys down at one time, because of how keyboards are made (not a software thing, its actually the keyboard that causes the problem).

Z.

Evil Techie
May 15th, 2002, 02:51 PM
yeah thats what ive been doing
thanx alot
but i need some sample code

this is giving me alot of painful headaches lately

/\/\isanThr0p
May 17th, 2002, 10:29 AM
like zaie said most keyboards wont accept more than 5 keys at a time (some only 3!) maybe it's also an issue of the pc, that I don't know
but for at least getting as many keys as your keyboard supports use the GetKeyState API