Hello.javascript:emoticon(':)')
I am embarrassed due to a similar symptom, too.
My environment
OS : Ubuntu 9.04 Desktop i386
Java version : 1.6.0_16 (Sun JDK Installed)
IDE : NetBeans 6.7.1
Keyboard : Scythe Model NO."SCKB03-BK" PS/2 Connecting
Mouse : Logicool MX518 USB Connecting
Code:
package slick.tutorial;
import org.newdawn.slick.*;
public class Lesson1 extends BasicGame {
static int height = 480;
static int width = 640;
static boolean fullscreen = false;
static boolean showFPS = true;
static String title = "Slick Basic Game Template";
static int fpslimit = 30;
public Lesson1(String title){
super(title);
}
public void init(GameContainer gc) throws SlickException{
}
public void update(GameContainer gc, int delta) throws SlickException{
Input input = new Input(height);
if(input.isMouseButtonDown(Input.MOUSE_RIGHT_BUTTON)) System.out.println("Mouse : Right Button Clicked !!");
if(input.isKeyDown(Input.KEY_ENTER)) System.out.println("Keyboard : ENTER Key Pressed !!");
}
public void render(GameContainer gc, Graphics g) throws SlickException{
}
public static void main(String[] args) throws SlickException{
AppGameContainer app = new AppGameContainer(new Lesson1(title));
app.setDisplayMode(width, height, fullscreen);
app.setSmoothDeltas(true);
app.setTargetFrameRate(fpslimit);
app.setShowFPS(showFPS);
app.start();
}
}
Output:
run:
Sat Nov 14 13:52:57 JST 2009 INFO:Slick Build #269
Sat Nov 14 13:52:57 JST 2009 INFO:LWJGL Version: 2.1.0
Sat Nov 14 13:52:57 JST 2009 INFO:OriginalDisplayMode: 1600 x 1200 x 24 @50Hz
Sat Nov 14 13:52:57 JST 2009 INFO:TargetDisplayMode: 640 x 480 x 0 @0Hz
Sat Nov 14 13:52:58 JST 2009 INFO:Starting display 640x480
Sat Nov 14 13:52:58 JST 2009 INFO:Use Java PNG Loader = true
Linux plugin claims to have found 5 controllers
Sat Nov 14 13:52:58 JST 2009 INFO:Found 0 controllers
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
Mouse : Right Button Clicked !!
構築成功 (合計時間: 19 秒) // Construction success (Total time : 19 seconds)
LWJGL is replaced with the latest thing.
Moreover, the permission of files has been changed.
sudo chmod o+r '/dev/input/event0'
sudo chmod o+r '/dev/input/event1'
sudo chmod o+r '/dev/input/event3'
sudo chmod o+r '/dev/input/event5'
The input of the mouse is perceivable in the output result.
However, the input of the keyboard cannot be perceived.
Is it possible to improve it by newly buying the keyboard?
Or, should I change in the PC environment?
Please advise.
I'm sorry in English cannot understood easily.
Thanks.javascript:emoticon(':D')
TekTek