Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (84 views)
2013-05-17 21:29:12

alaslipknot (92 views)
2013-05-16 21:24:48

gouessej (123 views)
2013-05-16 00:53:38

gouessej (117 views)
2013-05-16 00:17:58

theagentd (127 views)
2013-05-15 15:01:13

theagentd (114 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (187 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.175 seconds with 21 queries.