Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (489)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (555)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  DX Plugin Bug  (Read 1829 times)
0 Members and 1 Guest are viewing this topic.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Posted 2003-09-22 11:55:15 »

Ok, the bug could be in jinputtester.jar... but it looks deeper than that.. probably caused by a bad device driver, but I think we should try to fail more gracefully with it.

With a Logitech iTouch keyboard I get some strange devices showing up, I'm using the jinputtester.jar posted in another thread.  The keyboard is listed as three devices:
Keyboard (keyboard)
Internet Keys USB Internet Keys USB
Internet Keys USB Internet Keys USB

Yes those last two are named the same (and are listed with the name repeated)

If I select the first 'Internet Keys USB...' device, the jinputtester program starts spitting out this as it tries to poll:

java.lang.ArrayIndexOutOfBoundsException: 72
       at net.java.games.input.DirectInputAxis.getPollData(DirectInputAxis.java:148)
       at robs.jinput.AxisTableModel.getValueAt(AxisTableModel.java:60)
       at javax.swing.JTable.getValueAt(Unknown Source)
       at javax.swing.JTable.prepareRenderer(Unknown Source)
       at javax.swing.plaf.basic.BasicTableUI.paintCell(Unknown Source)
       at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
       at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
       at javax.swing.plaf.ComponentUI.update(Unknown Source)
       at javax.swing.JComponent.paintComponent(Unknown Source)
       at javax.swing.JComponent.paint(Unknown Source)
       at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
       at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
       at javax.swing.JComponent._paintImmediately(Unknown Source)
       at javax.swing.JComponent.paintImmediately(Unknown Source)
       at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
       at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
       at java.awt.event.InvocationEvent.dispatch(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)

Obviously the tester app is asking for an axis that is out of bounds.. but why?  It appears to be working fine for the other two devices and the mouse,  I assume it queries the number of axis from JInput, so I suspect that this device is reporting bad data to JInput, but  if the client code is written correctly, I think the exception shouldn't happen.. even if it is the devices fault, there is little that the client can do.. maybe JInput can do something to avoid the problem?, like some sort of internal checks that would avoid listing a device that it detects a problem with? Maybe some sort of blacklist of known problem devices?

Note that ControllerReadTest has the same problem.
Here is the error that it spews...
java.lang.ArrayIndexOutOfBoundsException: 63
       at net.java.games.input.DirectInputAxis.getPollData(DirectInputAxis.java:148)
       at net.java.games.input.test.AxisPanel.poll(ControllerReadTest.java:63)
       at net.java.games.input.test.ControllerWindow.poll(ControllerReadTest.java:224)
       at net.java.games.input.test.ControllerReadTest$1.run(ControllerReadTest.java:251)
       at java.lang.Thread.run(Unknown Source)

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #1 - Posted 2003-09-22 20:28:45 »

I have checked my code it is relying upon information given by JInput. An array of axes is requested from a controller and handled over to a TableModel that constructs one column for each axis.

This seems to be a strange error you encountered because as far as I know keyboard data is transferred via a 256 byte array in DirectInput (you didn't mention win32 but I think it is). It may be a problem on the java side thinking to have anything else than a keyboard-like controller and acquiring to less space for 'buttons'. Well, this may be caused due to incorrect driver interaction with DirectInput ...

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #2 - Posted 2003-09-22 21:27:23 »

Yes, it was Win32... I think the keyboard was a bit odd when I tried it on OS X as well... but at the time the JInput support for keyboards on OS X 10.2 was a tad odd.  I will try again on OS X and maybe linux.  I strongly suspect bogus info is coming from the device itself.  I bet it doesn't follow the USB HID spec properly.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #3 - Posted 2003-09-23 19:03:56 »

Look what i've found here (DirectInputKeyboard.java):
1  
private byte[] keyData = new byte[256];


I think this means that your keyboard isn't recognized as a keyboard.  When it would have been recognized correctly an AIIOB-Exception on index 72 cannot happen with this class ...

I have found some comments in the dxplugin that states that the constants used in the java code are taken from dinput header files and that this may be a little bit unstable. Maybe someone has used outdated header files or miss-typed/copy-pasted something.

I will soon add some BeanShell support to my inputtester application. That way you will be able to inspect your input devices even more ....

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #4 - Posted 2003-09-23 19:41:26 »

Quote
I think this means that your keyboard isn't recognized as a keyboard.  When it would have been recognized correctly an AIIOB-Exception on index 72 cannot happen with this class ...

Ah, but it is..it is recognized as a keyboard AND two other devices.  One of those other devices lists a few buttons, sleep, wake up, etc.. some that I can't even find on the keyboard!  But the other device causes the index error.

Note that this keyboard has multimedia keys (play,stop,volume up/down, etc.) a scroll wheel, and many programmable keys (Go, Finance, My Sites, Community, Favourites, E-Mail, Shopping, Search, My Home, iTouch)
Logitech Internet Navigator Keyboard  P/N: 867150-0100  for anyone that might care.

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #5 - Posted 2003-09-23 20:57:06 »

Strange piece of hardware you've get Cheesy
I am interested of what type JInput recognizes the controller 'Internet Keys USB'. BeanShell is comming ...

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (14 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

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

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

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

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

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

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

BurntPizza (48 views)
2014-08-09 21:09:32
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!