Slick Forums

Discuss the Slick 2D Library
It is currently Sun Feb 17, 2019 4:07 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Apr 19, 2011 6:35 am 
Offline
Regular

Joined: Sat Aug 16, 2008 7:04 pm
Posts: 119
When I hold multiple keys down, for example in this order:
left, right, up.

What happends is, the game does not register "up" as down. This also happends with other combinations like up,right,left and down -> down not registered.

I wrote a little test-class so you can see this, Just try holding down 3 or 4 keys.
Code:
package org.newdawn.slick.tests;
   
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.util.Bootstrap;

public class KeysDownTest extends BasicGame {
   
   private Input input;
   private int x = 100;
   private int y = 240;
         
   private boolean l;
   private boolean r;
   private boolean u;
   private boolean d;
   
   public KeysDownTest() {
      super("LRUD Test");
   }
   
   public void init(GameContainer container) throws SlickException {
      input = container.getInput();
   }

   public void render(GameContainer container, Graphics g) {
        g.drawString("left  "+l, x, y);
        g.drawString("right "+r, x, (y + 20));
        g.drawString("up "+u, x, (y + 40));
        g.drawString("down "+d, x, (y + 60));       
      
   }

   public void update(GameContainer container, int delta) {
   l = input.isKeyDown(Input.KEY_LEFT);
        r = input.isKeyDown(Input.KEY_RIGHT);
        u = input.isKeyDown(Input.KEY_UP);
        d = input.isKeyDown(Input.KEY_DOWN);
       
   }
      
   public static void main(String[] argv) {
      Bootstrap.runAsApplication(new KeysDownTest(), 400, 400, false);
   }
}

_________________
Gamedev link-collection (german page)
My Gamedev Blog
Play Cyber Dungeon Quest!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 7:05 am 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
We already had this issue in this thread:
http://slick.javaunlimited.net/viewtopic.php?t=3093

It's a hardware thing depending on your/any keyboard and can't be solved.

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2011 7:54 am 
Offline
Regular

Joined: Sat Aug 16, 2008 7:04 pm
Posts: 119
Ok so where does this thread go then?

_________________
Gamedev link-collection (german page)
My Gamedev Blog
Play Cyber Dungeon Quest!


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

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
An admin should move this to Resolved Bugs/RFEs.

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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