Пример #1
0
 /** @see org.newdawn.slick.BasicGame#keyPressed(int, char) */
 @Override
 public void keyPressed(int key, char c) {
   count++;
   if (key == Input.KEY_SPACE) {
     if (input.isKeyRepeatEnabled()) input.disableKeyRepeat();
     else input.enableKeyRepeat();
   }
 }
Пример #2
0
 /**
  * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer,
  *     org.newdawn.slick.Graphics)
  */
 @Override
 public void render(GameContainer container, Graphics g) {
   g.drawString("Key Press Count: " + count, 100, 100);
   g.drawString("Press Space to Toggle Key Repeat", 100, 150);
   g.drawString("Key Repeat Enabled: " + input.isKeyRepeatEnabled(), 100, 200);
 }