Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 19, 2013 1:49 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Sun Mar 06, 2011 6:33 am 
Offline

Joined: Wed Sep 17, 2008 1:06 am
Posts: 96
Something weird I noticed -- pressing and holding the up and left arrow keys, then pressing the space bar makes it so isKeyDown returns false for the space bar. Holding the space bar and then the arrow keys works fine, though. Why is this?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 7:39 am 
Offline

Joined: Fri Mar 04, 2011 12:34 pm
Posts: 24
I could be wrong but isnt it normal that the OS only takes 2 key inputs in general? Ive tried what you said and I always get only 2 outputs. Always the 2 keys I pressed first. What I press after them is ignored unless I release one key.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 12:18 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Actually you should be able to press more than two keys... Can you show some code? (Maybe clearing the key input helps :D)

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 2:11 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
It often depends on your hardware. For example my desktop PC can take 3 keys without any problem.
My laptop can mostly only take two keys but some 3 key combinations do work.

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 3:21 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Okay that's new...
I made some tests, and I can push 6 keys simultaneously o_O (and more...)

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 3:39 pm 
Offline
Regular

Joined: Tue Jun 19, 2007 7:35 am
Posts: 233
Location: Germany
At least on windows you have that issue. Using two Arrow-Keys and Space-Bar at the same time leads to "beep". With a USB Keyboard you shouldn't have that issue, i know it from the good old PS2-Connector.

_________________
Embero Games | Astroiz | ConK | From Outa Space


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 5:12 pm 
Offline

Joined: Wed Sep 17, 2008 1:06 am
Posts: 96
Pushing a different pair of arrow keys still lets the space bar work. This only happens with up and left.

Also, no beep here.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 06, 2011 5:29 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1171
The issue might be your keyboard. With ~105 keys on a keyboard you would need >105 pins on the keyboard controller IC to read all pins at the same time. So most keyboards use a matrix to read the pins which will lead to restrictions on which and how many keys can be pressed at the same time. There is no norm or standard for this. But it is likely that you can use one horizontal and one vertical arrow together with the modifier keys (control, shift, alt).

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 07, 2011 7:21 pm 
Offline
Regular

Joined: Sun Dec 07, 2008 5:22 am
Posts: 238
Location: Vancouver, BC, Canada
Oh how I hate this problem. It's entirely a keyboard hardware thing.
http://www.sjbaker.org/wiki/index.php?title=Keyboards_Are_Evil

There are a few keys that are guaranteed not to mask: Ctr Alt Delete Esc
And few that are very unlikely to mask: Shift Tab Enter Space Backspace

On old gaming keyboards it is not uncommon for the every key on the numpad to be isolated.
On new gaming keyboards it is not uncommon for WASD and the Function keys to be isolated.

_________________
If at first quads don't succeed tri tri again.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 8:10 am 
Offline

Joined: Sun Mar 27, 2011 6:44 pm
Posts: 87
Location: Finland
This is hardware thing but game dev can't blame user hardware so we should have figure best solution to this. Which are best movement and action keys for average player?
Movement is little easier. You just can do movement so intuitive that player never have to push more than two arrow key at same time.
But how about action keys? Is control good? Do space have more problems? Z and X are almoust standard keys if you have to pick a char.

Let's figure out best practise for this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 8:33 am 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
I think the link that Chronocide provided (that one: http://www.sjbaker.org/wiki/index.php?title=Keyboards_Are_Evil) already contains a good mapping of interfering keys.

Best workaround is to provide an option to define your own keyboard mapping for the game.

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 8:51 am 
Offline

Joined: Sun Mar 27, 2011 6:44 pm
Posts: 87
Location: Finland
I just don't see that average player would try hassle with keyboard mapping. It's good solution if you just want other programmers test your game put it's not solution for final users.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 9:53 am 
Offline
Regular

Joined: Tue Jun 19, 2007 7:35 am
Posts: 233
Location: Germany
pitbuller wrote:
I just don't see that average player would try hassle with keyboard mapping. It's good solution if you just want other programmers test your game put it's not solution for final users.


Most / Many games have the option to change the keyboard / controller mapping. It's always a good move to allow people to adapt the controls to their style.

For example WASD is the standard-movement binding for FPS type games but i've seen other players which used ESDF or good ol' Arrow-Keys too.

Just my 2 cents

_________________
Embero Games | Astroiz | ConK | From Outa Space


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 4:22 pm 
Offline

Joined: Sun Mar 27, 2011 6:44 pm
Posts: 87
Location: Finland
TheMatrix154 wrote:
pitbuller wrote:
I just don't see that average player would try hassle with keyboard mapping. It's good solution if you just want other programmers test your game put it's not solution for final users.


Most / Many games have the option to change the keyboard / controller mapping. It's always a good move to allow people to adapt the controls to their style.

For example WASD is the standard-movement binding for FPS type games but i've seen other players which used ESDF or good ol' Arrow-Keys too.

Just my 2 cents

Yeah. Its good to have but same time we should make games where noone would need have to use it.

Basic usability principle: It's good to have manual but it's even better if user don't need to have it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group