Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Maximum simultaneous keypresses
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Drahcir




PostPosted: Sun May 17, 2009 9:49 pm   Post subject: Maximum simultaneous keypresses

I've been writing a two-player shooting game in Java that takes in keyboard buttons with keyPressed and keyReleased, but I've run into a problem.
Apparently only 3 or 4 keys can be pressed down at the same time, before it starts not taking any more key input. The only way to do more commands is to let go of one of the keys. Is there any way to solve this problem?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun May 17, 2009 10:21 pm   Post subject: RE:Maximum simultaneous keypresses

I'm not sure, but I believe there is some limitation simply in the amount of keys an average keyboard registers at any time. So, this problem may or may not have anything to do with Java. Perhaps that will provide more motivation to let your game run over a network? Smile
zylum




PostPosted: Mon May 18, 2009 1:15 am   Post subject: RE:Maximum simultaneous keypresses

Have a boolean array for the keys.. In the pressed handler, set the appropriate index to true and in the release handler, set it to false. Then simply use this array to see which keys are pressed..
r691175002




PostPosted: Tue May 19, 2009 1:06 am   Post subject: Re: Maximum simultaneous keypresses

This is the limitation of your keyboard, not Java.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: