Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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: JInput not working correctly in applets on: 2009-03-23 15:58:42
Is the JInput API really unstable? I would hope that if major, incompatible changes were ever made to the JInput API, then it would be given a new package name so as not to clash with the previous version. If there is no goal to do this, then I suppose (1) is a valid point.

However are you sure about (2) and (4)? I have verified that the native libraries do get loaded from lib/ext, even from an unsigned applet.
2  Java Game APIs & Engines / JInput / Re: JInput not working correctly in applets on: 2009-03-23 10:38:01
If the JInput jar is placed into lib/ext, isn't it automatically granted the privileges to access whatever it needs to access?
3  Java Game APIs & Engines / JInput / Re: JInput not working correctly in applets on: 2009-03-23 00:54:40
Hi endolf, I saw your resource loader before actually. It's really cool, nice job! And, it works. But... as I mentioned, I would like not to change my delivery mechanism.

Could it be that the reason your applet works has nothing to do with the resource loader (and would work just as well with lib/ext), and has more to do with the fact that your applet creates JFrames? Can you make a normal applet that runs entirely inside of the applet component and can poll the keyboard using JInput? This would correspond more to what I am hoping to achieve.

If I set the plugin to directx as you suggested, it is then possible to poll the keyboard from within the applet. This is great, except that in order to set the various properties, the applet must be signed, and this changes my delivery mechanism. I do not want users to have to click a button to trust this applet. Also, you mentioned that the directx plugin does not support multiple keyboards and mice. This is ok, but how about joysticks? I will eventually want to support a joystick inside the applet.

Ideally, JInput could be fixed to work inside an applet by default. Is this possible? Thanks again.
4  Java Game APIs & Engines / JInput / Re: JInput not working correctly in applets on: 2009-03-22 10:28:45
I'm also not running this code from a console, for me, I used it in an applet.

By the way, another option is to try the game to see if you get the same problem with my code: http://hi-games.net/tessellate-t,lt,O,d/

The polled keys are: Z, X, Arrow keys and Space. You can press F9 *after* the game has started to see if JInput was detected by the applet (if it says "Direct", then it was detected).

When JInput is in lib/ext, keyboard input works on Linux, but not on Windows. When JInput is not in lib/ext, it works on all platforms using standard AWT events.

Thanks for looking into the problem.
5  Java Game APIs & Engines / JInput / Re: JInput not working correctly in applets on: 2009-03-21 23:59:21
If I print "Checking for events" just before the inner loop, the program shows that the outer loop is repeating regularly, so this is not it.

Also, if I use keyboard.isKeyDown(...) instead of events, this method always returns false on WINDOWS.

Were you able to reproduce the problem with the code I provided?
6  Java Game APIs & Engines / JInput / JInput not working correctly in applets on: 2009-03-21 16:05:28
I am developing an applet that will use JInput if it is present (in the user's "lib/ext" directory), or will otherwise fall back to standard java.awt techniques.

Here is the problem:

When JInput is detected on LINUX, keyboard events are detected fine, but mouse events are not.
When JInput is detected on WINDOWS, mouse events are detected fine, but keyboard events are not.

My game depends on keyboard input, so the second problem is worse for me.

Here is the code I'm using to see what events are being detected by JInput:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
Event event = new Event();
while (...)
{
    for (int i = 0; i < controllers.length; i++)
    {
        controllers[i].poll();
        EventQueue queue = controllers[i].getEventQueue();
        while(queue.getNextEvent(event))
            System.out.println(event);
    }
}

By printing out the array of controllers, I can also verify that a keyboard controller is found by JInput in both WINDOWS and LINUX, but it just doesn't do anything in WINDOWS.

I noticed that a similar problem was described in the thread "JInput and Java 1.6.0_10" although this might be a different problem because in my case there is evidence that things are at least "partially" working.

Is there a solution that doesn't fundamentally change the delivery approach of an applet loading JInput from lib/ext?

My LINUX Java version is 1.6.0_10-beta-b14 (but I unfortunately don't have the WINDOWS Java version at hand).

Thank you
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.

atombrot (23 views)
2014-08-19 09:29:53

Tekkerue (22 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (57 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (29 views)
2014-08-08 02:01:56

Norakomi (36 views)
2014-08-06 19:49:38

BurntPizza (66 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!