Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12046 Posts in 1593 Topics- by 597 Members - Latest Member: Cydfewoot

21. May 2013, 06:48:33 pm
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)JAGaToo's new InputSystem is ready!
Pages: [1] 2 3
Print
Author Topic: JAGaToo's new InputSystem is ready!  (Read 9483 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« on: 01. May 2008, 03:40:35 pm »

Was lange währt, wird endlich gut. - I'm sure, you will find a good translation Wink.

Sorry for having taken so long. But now it is ready, the xith3d branch and xith-tk branch have completely been ported and I have written some documentation (additionally to the JavaDoc).

Now I need opinions and critics before I merge it into the trunks. So, please checkout the branches (both are called "with-new-inputsystem"), download the documentation, read it and tell me, what you think.

Are there any features, that you're missing? Are there any classes, that have bad names? Is anything too complicated? Is there anything good it it Wink?

The easiest way to checkout the branches with existing xith3d/xith-tk eclipse projects is to use
Team->Switch to another Branch/Tag...
And use this url:
https://xith3d.svn.sourceforge.net/svnroot/xith3d/branches/with-new-inputsystem/trunk
(similar for xith-tk)

I personally believe, that it has become quite cool Cool.

Marvin

PS: There's a testcase in the JAGaToo project (in a separate test-source folder), that uses (nearly) all features.
« Last Edit: 01. May 2008, 03:46:30 pm by Marvin Fröhlich » Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #1 on: 01. May 2008, 07:53:56 pm »

When running the jagatoo testcase, I get this output, then the program exits:

CTE-440-U V4.0-3
LWJGLKeyboard { name = "Primary Keyboard", localization-mapping = "org.jagatoo.input.localization.mappings.german.MappingGermany" }
LWJGLMouse { name = "Primary Mouse", numButtons = 5, hasWheel = true }
LWJGLController { name = "CTE-440-U V4.0-3", numAxes = 0, numButtons = 0 }
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
   at org.jagatoo.input.devices.Controller.getButton(Controller.java:109)
   at org.jagatoo.test.input.InputTest.setupInputBindings(InputTest.java:290)
   at org.jagatoo.test.input.InputTest.setupInputSystem(InputTest.java:399)
   at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:571)
   at org.jagatoo.test.input.InputTest.<init>(InputTest.java:678)
   at org.jagatoo.test.input.InputTest.main(InputTest.java:685)
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #2 on: 01. May 2008, 08:34:22 pm »

Hmm... looks like you have some kind of input device plugged in to your system, which is detected as a controller, but doesn't have buttons. Any idea, what the might be?

I have applied a patch, that should fix that. Please update and try again.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #3 on: 01. May 2008, 09:58:52 pm »

Hmm...maybe my Wacom tablet, maybe my webcam, otherwise I can't think of anything...but, my Wacom tablet has two buttons and a scroll wheel, and even my webcam has a snapshot button.

I'll unplug these devices to get it to run properly, but for now I can find errors with it/them... Grin

OK, I'm past that error, now I get this:

Exception in thread "main" java.lang.NullPointerException
   at org.jagatoo.test.input.InputTest.setupInputSystem(InputTest.java:384)
   at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:571)
   at org.jagatoo.test.input.InputTest.<init>(InputTest.java:678)
   at org.jagatoo.test.input.InputTest.main(InputTest.java:685)

EDIT: Ah, wait, I found what it is.  I had a MIDI keyboard hooked up to my computer.

EDIT2: Actually, my Wacom makes this error too.  Also, I get this error sometimes:
Exception in thread "main" java.lang.NullPointerException
   at org.jagatoo.input.managers.InputStatesManager.updateState_(InputStatesManager.java:167)
   at org.jagatoo.input.managers.InputStatesManager.internalUpdateState(InputStatesManager.java:202)
   at org.jagatoo.input.InputSystem.notifyInputStatesManagers(InputSystem.java:188)
   at org.jagatoo.input.impl.lwjgl.LWJGLMouse.collectOrFireEvents(LWJGLMouse.java:169)
   at org.jagatoo.input.impl.lwjgl.LWJGLMouse.update(LWJGLMouse.java:276)
   at org.jagatoo.input.InputSystem.updateMouses(InputSystem.java:1099)
   at org.jagatoo.input.InputSystem.update(InputSystem.java:1142)
   at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:577)
   at org.jagatoo.test.input.InputTest.<init>(InputTest.java:678)
   at org.jagatoo.test.input.InputTest.main(InputTest.java:685)
« Last Edit: 01. May 2008, 10:07:08 pm by kukanani » Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #4 on: 01. May 2008, 10:30:24 pm »

The NPE in InputStatesManager should be gone. and I think, I found the reason for the other NPE, too. Now there shouldn't be any problems with your extra hardware anymore.

Marvin
« Last Edit: 01. May 2008, 10:43:10 pm by Marvin Fröhlich » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #5 on: 01. May 2008, 11:23:19 pm »

I have fixed some other problems with Joystick detection. Please update and check again. Thanks.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #6 on: 01. May 2008, 11:25:40 pm »

Yay! No errors!

Thanks, Marvin.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #7 on: 01. May 2008, 11:29:22 pm »

Yay! No errors!

Thanks, Marvin.

Cool Smiley. Thanks for testing.

Now, what do you think about the new InputSystem? And could you please download the documentation and tell me, what you think about it?

Oh, btw. I need people to write an implementation of the Keyboard-localization for other languages.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #8 on: 02. May 2008, 03:07:49 am »

Quote
Cool. Thanks for testing.
Sure, no problem.

Quote
Now, what do you think about the new InputSystem?
Sorry, but I still seem to be having some problems.  I don't get any output beyond the initial, which I guess means that no events are being fired.  I tried unplugging everything except my standard keyboard and a normal optical mouse, but still I get no events firing.  Cry

Quote
..could you please download the documentation and tell me, what you think about it?
The doc is great.  It is really comprehensive and easy to understand, and it covers a lot of ground.  Good work.

Quote
Oh, btw. I need people to write an implementation of the Keyboard-localization for other languages.
I'll check it out...if I have time, I'll give it a whirl.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #9 on: 02. May 2008, 01:43:33 pm »

Sorry, but I still seem to be having some problems.  I don't get any output beyond the initial, which I guess means that no events are being fired.  I tried unplugging everything except my standard keyboard and a normal optical mouse, but still I get no events firing.  Cry

Well, maybe I should have said, that the testcase is not meant to be a run-and-don't-care testcase, but is meant to be read and modified. There are some debugging flags on the top of the class, that are all disabled by default. To make all events being dumped out you need to enable the first four flags. This is simply done by commenting out the lines #101-104.

My question about, what you think about the InputSystem, was not primarily "how does it work?", but more of "How do you like the API?" and "Is the way to use it ok for you?".

The doc is great.  It is really comprehensive and easy to understand, and it covers a lot of ground.  Good work.

Thanks.

I'll check it out...if I have time, I'll give it a whirl.

Thanks.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #10 on: 02. May 2008, 08:30:45 pm »

Quote
My question about, what you think about the InputSystem, was not primarily "how does it work?", but more of "How do you like the API?" and "Is the way to use it ok for you?".
Oh, ok.

Anyway, it's really simple and intuitive...so I like it. Nice, nice work.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #11 on: 03. May 2008, 12:16:00 am »

Anyway, it's really simple and intuitive...so I like it. Nice, nice work.

OK. Thanks Smiley. If nobody else will reply to this thread, I will just merge the xith3d/xith-tk InputSystem-branches into the trunk at monday.

Marvin
Logged
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #12 on: 03. May 2008, 08:20:49 am »

Just few remarks,

If have my antivirus software (Kaskersky 7) which consider the new Jagatoo Input system as a keylogger.
To be more user-friendly (especially for end user) it should be nice to avoid this message...

When a key is not recognized (maybe due to keyboard localization) the testcase crashes.
At the line 200, key is null so we have this NullPointerException:
Code:
Exception in thread "main" java.lang.NullPointerException
at org.jagatoo.input.devices.Keyboard.prepareKeyPressedEvent(Keyboard.java:200)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.collectOrFireEvents(LWJGLKeyboard.java:239)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.update(LWJGLKeyboard.java:338)
at org.jagatoo.input.InputSystem.updateKeyboards(InputSystem.java:1084)
at org.jagatoo.input.InputSystem.update(InputSystem.java:1141)
at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:578)
at org.jagatoo.test.input.InputTest.<init>(InputTest.java:679)
at org.jagatoo.test.input.InputTest.main(InputTest.java:686)

I will try to write an implementation for french keyboard in the next days..

For the feedback, even if i didn't have digged too much, your document and the API are very clear and simple to use.
Again, very nice work Marvin!  Wink
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #13 on: 03. May 2008, 02:14:49 pm »

If have my antivirus software (Kaskersky 7) which consider the new Jagatoo Input system as a keylogger.
To be more user-friendly (especially for end user) it should be nice to avoid this message...

Please try to use AWT. You can switch that in the lines #679-681 of the testcase. If it is still considered to be a keylogger, then I have no idea, why. And I don't even see, why LWJGL should be detected as a keylogger. JInput certainly is. But the JInput Keyboard code is not used at all. Oh, wait. Maybe it is just because the JInput Keyboard class is used. Please try to comment out the lines #383-388 to avoid Controller initialization.

When a key is not recognized (maybe due to keyboard localization) the testcase crashes.
At the line 200, key is null so we have this NullPointerException:
Code:
Exception in thread "main" java.lang.NullPointerException
at org.jagatoo.input.devices.Keyboard.prepareKeyPressedEvent(Keyboard.java:200)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.collectOrFireEvents(LWJGLKeyboard.java:239)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.update(LWJGLKeyboard.java:338)
at org.jagatoo.input.InputSystem.updateKeyboards(InputSystem.java:1084)
at org.jagatoo.input.InputSystem.update(InputSystem.java:1141)
at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:578)
at org.jagatoo.test.input.InputTest.<init>(InputTest.java:679)
at org.jagatoo.test.input.InputTest.main(InputTest.java:686)

Thanks. It is fixed now.

I will try to write an implementation for french keyboard in the next days..

That would be cool.

For the feedback, even if i didn't have digged too much, your document and the API are very clear and simple to use.
Again, very nice work Marvin!  Wink

Thanks.

Marvin
Logged
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #14 on: 03. May 2008, 03:35:29 pm »

If I switch to AWT , it's OK.. no warning.
If I comment the lines #383-388 with LWJGL it's also OK.
If I comment the lines #383-388 with AWT it's also OK.

In fact, the warning appears only when you are in LWJGL and lines #383-388 are enabled. (the testcase by default Wink )

For the null pointer i still have exceptions:
With LWJGL :
Code:
Exception in thread "main" java.lang.NullPointerException
at org.jagatoo.input.managers.InputStatesManager.internalUpdateState(InputStatesManager.java:196)
at org.jagatoo.input.InputSystem.notifyInputStatesManagers(InputSystem.java:188)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.collectOrFireEvents(LWJGLKeyboard.java:241)
at org.jagatoo.input.impl.lwjgl.LWJGLKeyboard.update(LWJGLKeyboard.java:338)
at org.jagatoo.input.InputSystem.updateKeyboards(InputSystem.java:1084)
at org.jagatoo.input.InputSystem.update(InputSystem.java:1141)
at org.jagatoo.test.input.InputTest.startLWJGL(InputTest.java:578)
at org.jagatoo.test.input.InputTest.<init>(InputTest.java:679)
at org.jagatoo.test.input.InputTest.main(InputTest.java:686)

With AWT:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.jagatoo.input.impl.awt.AWTKeyboard.processKeyEvent(AWTKeyboard.java:367)
at org.jagatoo.input.impl.awt.AWTKeyboard.access$1(AWTKeyboard.java:357)
at org.jagatoo.input.impl.awt.AWTKeyboard$1.keyPressed(AWTKeyboard.java:459)
at java.awt.Component.processKeyEvent(Component.java:5996)
at java.awt.Component.processEvent(Component.java:5815)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:697)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:962)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:834)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:661)
at java.awt.Component.dispatchEventImpl(Component.java:4282)
at java.awt.Component.dispatchEvent(Component.java:4240)
Logged
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic