Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 8:48 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Fri Mar 13, 2009 12:45 pm 
Offline

Joined: Fri Mar 13, 2009 12:36 pm
Posts: 1
Hi,
I have Ubuntu Linux 8.10 with Java 1.6.
In almost all of the example games using Slick, keyboard controls are not working. For example in Super Trooper, Virium and Horrah.
Mouse is working properly but I have absolutely no response on hitting the keyboard keys.
In some games, one of the messages im getting is : "INFO:Controllers not available". Maybe it has something to do with it.
Anybody knows a solution ?

The only example where keyboard works for me is Beetle Mania which I start from the Slick webpage. But I can not find its source code. Where is it ?

Thanks
SlickUser


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 9:37 am 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Are you sure you have read permission to the /dev/* keyboard event inputs thingers in linux.

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 04, 2009 8:51 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Try upgrading the LWJGL version in use. No responses for a while, is this still a problem?

Kev


Top
 Profile  
 
PostPosted: Sat Nov 14, 2009 9:52 am 
Offline

Joined: Sat Nov 14, 2009 9:09 am
Posts: 8
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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 14, 2009 10:59 pm 
Offline
User avatar

Joined: Sun Jul 26, 2009 11:26 pm
Posts: 11
replace

Input input = new Input(height);

with

Input input = gc.getInput();

and try again.

Not sure if that is the problem though... but at least this way works for me (also on ubuntu).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 15, 2009 4:31 am 
Offline

Joined: Sat Nov 14, 2009 9:09 am
Posts: 8
We wish to express our gratitude for an early answer. count. :D

However, the input from the keyboard was not able to be acquired
though Code was changed as pointed out.

I want to use "Slick" is very attractively for me.
When any thing advises, it is welcome. :)

TekTek


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 09, 2009 1:32 am 
Offline

Joined: Sat Nov 14, 2009 9:09 am
Posts: 8
As for the input of the keyboard,
it is the one by the relation between InputMethod(SCIM or iBus) of
Japanese version Ubuntu and LWJGL?

LWJGL Forums
http://lwjgl.org/forum/index.php/topic,2851.0.html

It was not solved though IM changed from SCIM into iBus
in Japanese version Ubuntu9.10.
The problem doesn't happen in the state to stop iBus.
However, Japanese input becomes impossible.
:shock:...


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

All times are UTC


Who is online

Users browsing this forum: No registered users 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