Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JInput / Re: How to use keyboard on: 2009-06-01 19:37:51
no, i only detected the keyboard. And I tryed do this

 
I tryed do it. But isn't work =(

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
package net.java.games.input.test;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Keyboard;

public class ControllerManager {
   private static Keyboard keyboard = findKeyboard();
   
   private static Keyboard findKeyboard()
   {
      ControllerEnvironment controllerEnvironment =ControllerEnvironment.getDefaultEnvironment();
      Controller[] aController = controllerEnvironment.getControllers();
      for (int i = 0; i < aController.length; i++)
         if (aController[i].getType() == Controller.Type.KEYBOARD)
            return (Keyboard)aController[i];
      return null;
   }
   
   
public static void main(String[] args) {
   

   while(true){
     
      if (keyboard.isKeyDown(net.java.games.input.Component.Identifier.Key.A)){
               System.out.println("I'm pressed");
            }
   
   }
   
   
}

}


but did'nt work.
2  Java Game APIs & Engines / JInput / Re: How to use keyboard on: 2009-06-01 18:19:07
From eclipse IDE. "VM arguments"
3  Java Game APIs & Engines / JInput / Re: How to use keyboard on: 2009-05-29 19:13:00
I using Linux too, but i set this "-Djinput.plugins=net.java.games.input.AWTEnvironmentPlugin" in my VM.
4  Java Game APIs & Engines / JInput / Re: How to use keyboard on: 2009-05-29 05:21:37
I tryed do it. But isn't work =(

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
package net.java.games.input.test;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Keyboard;

public class ControllerManager {
   private static Keyboard keyboard = findKeyboard();
   
   private static Keyboard findKeyboard()
   {
      ControllerEnvironment controllerEnvironment =ControllerEnvironment.getDefaultEnvironment();
      Controller[] aController = controllerEnvironment.getControllers();
      for (int i = 0; i < aController.length; i++)
         if (aController[i].getType() == Controller.Type.KEYBOARD)
            return (Keyboard)aController[i];
      return null;
   }
   
   
public static void main(String[] args) {
   

   while(true){
     
      if (keyboard.isKeyDown(net.java.games.input.Component.Identifier.Key.A)){
               System.out.println("I'm pressed");
            }
   
   }
   
   
}

}
5  Java Game APIs & Engines / JInput / How to use keyboard on: 2009-05-27 19:32:00
How to use keyboard + JInput ?

i did'nt found it on google =9

Examples are welcome. =p
6  Java Game APIs & Engines / JInput / Re: JInput and Linux on: 2009-05-19 06:21:38
I put  "  -Djinput.plugins=net.java.games.input.AWTEnvironmentPlugin " in my run configurations/ Arguments (eclipse) and I run this code:


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public class ControllerManager {

   public static void main(String[] args) {
      ControllerEnvironment controllerEnvironment = ControllerEnvironment
            .getDefaultEnvironment();
      Controller[] aController = controllerEnvironment.getControllers();
      for (int iController = 0; iController < aController.length; iController++) {
         Controller controller = aController[iController];
         System.out.println(controller.getType());
      }
   }

}


and i've this output
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
Loading: net.java.games.input.AWTEnvironmentPlugin
Loading: net.java.games.input.LinuxEnvironmentPlugin
Failed to open device (/dev/input/event5): Failed to open device /dev/input/event5 (13)

Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)

Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)

Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)

Linux plugin claims to have found 2 controllers
Keyboard
Mouse
Mouse
Mouse


So... I've a keyboard  and mouse =~~~ and I don't change any permission =)

Now I Want test if it really work. But i don't found a good tutorial about Keyboard + JInput  Undecided

Someone can help ?  Grin
7  Java Game APIs & Engines / JInput / Re: JInput and Linux on: 2009-05-18 03:35:51
Endolf, tankyou for help.

Sorry to the noob question, but where I set this plugin?.  Tankyou.
8  Java Game APIs & Engines / JInput / Re: JInput and Linux on: 2009-05-15 19:26:53
Quote
No worries, it's good enough to understand the question
Thanks =)

Quote
There is the option of adding the AWT plugin in, this only handles system mouse and keyboard, so no multple device support, and no joysticks etc.

With this  can I use the mouse and keybord at same time ? My linux keylistener return aways this:

KEYPRESSED
KEYRELEASED
KEYPRESSED
KEYRELEASED
KEYPRESSED
KEYRELEASED

on windows( Angry) it returns   (WHY GOD?)

KEYPRESSED
-
-
-
KEYRELEASED

with this can I fix the repeat problem ?     I wrote a Timed Key Listener, on my Desk Pc Work fine but on my Laptop(core DUO) did'nt.


If it works.  you know a example ?

Tankyou endolf
9  Java Game APIs & Engines / JInput / Re: JInput and Linux on: 2009-05-15 04:53:24
 Hi,  Grin

I have the same problem, i tried use the KeyListener, but this don't work well at Linux Sad. So, i tried use the JInput and I has the problem with permissions.  Cry

So... this is very old topic. Has anything new?

Is the best way tell to user "Change your permissions" ?

Sorry to bad english. Smiley

Tankyou Tongue
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (31 views)
2014-04-15 18:08:23

BurntPizza (28 views)
2014-04-15 03:46:01

UprightPath (43 views)
2014-04-14 17:39:50

UprightPath (25 views)
2014-04-14 17:35:47

Porlus (42 views)
2014-04-14 15:48:38

tom_mai78101 (64 views)
2014-04-10 04:04:31

BurntPizza (124 views)
2014-04-08 23:06:04

tom_mai78101 (223 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!