Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 12:56:33 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Jagatoo right click exception
Pages: [1]
Print
Author Topic: Jagatoo right click exception  (Read 1105 times)
Pathogen
Just dropped in

Offline Offline

Posts: 8


View Profile
« on: 12. November 2009, 04:11:22 pm »

Hello, it's been a while since I've posted. Anyhow,

I've run into a strange bug somewhere in Jagatoo. Making a right click on my laptop's touchpad mouse buttons causes an exception, if the mouse is registered with the inputsystem. Specifically, the crash only happens when I release the mouse button. My 'onMouseButtonPressed' listener's code runs, but my 'onMouseButtonReleased' code never does.

It gets stranger: while I have a USB mouse plugged in, its right click does not cause the crash... and neither do the right click buttons on the keyboard anymore. But only for that instance of the program, if I unplug the mouse, and restart the program, the exception returns.

I checked out the xith3d and xith-tk trunks, and the problem is still here. My machine is a thinkpad R51, the built in mousepad has two right and two left mouse buttons, and a single centre button. Not sure if that unusual setup matters to this.

Thanks for any help,

Code:
java.lang.ArrayIndexOutOfBoundsException: 2
at org.jagatoo.input.devices.Mouse.prepareMouseButtonReleasedEvent(Mouse.java:457)
at org.jagatoo.input.impl.lwjgl.LWJGLMouse.collectOrFireEvents(LWJGLMouse.java:203)
at org.jagatoo.input.impl.lwjgl.LWJGLMouse.updateMouse(LWJGLMouse.java:277)
at org.jagatoo.input.devices.Mouse.update(Mouse.java:773)
at org.jagatoo.input.InputSystem.updateMouses(InputSystem.java:1135)
at org.jagatoo.input.InputSystem.update(InputSystem.java:1178)
at org.xith3d.base.Xith3DEnvironment.updateInputSystem(Xith3DEnvironment.java:210)
at org.xith3d.loop.RenderLoop.prepareNextFrame(RenderLoop.java:593)
at org.xith3d.loop.RenderLoop.loopIteration(RenderLoop.java:638)
at org.xith3d.loop.RenderLoop.update(RenderLoop.java:698)
at org.xith3d.loop.UpdatingThread.nextIteration(UpdatingThread.java:473)
at org.xith3d.loop.RenderLoop.nextIteration(RenderLoop.java:709)
at org.xith3d.loop.RenderLoop.loop(RenderLoop.java:762)
at org.xith3d.loop.UpdatingThread.run(UpdatingThread.java:526)
at org.xith3d.loop.RenderLoop.run(RenderLoop.java:785)
at org.xith3d.loop.RenderLoop.begin(RenderLoop.java:841)
at org.xith3d.loop.RenderLoop.begin(RenderLoop.java:871)
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 12. November 2009, 06:50:28 pm »

This is really strange. Could you please tell me, what this call returns on your system?
Code:
org.lwjgl.input.Mouse.getButtonCount()

Marvin
Logged
Pathogen
Just dropped in

Offline Offline

Posts: 8


View Profile
« Reply #2 on: 12. November 2009, 07:37:51 pm »

This is really strange. Could you please tell me, what this call returns on your system?
Code:
org.lwjgl.input.Mouse.getButtonCount()

Marvin

The output is 3.

Edit: Correction: the output is 3 with the USB mouse attached. I've just been leaving it in to avoid the crash... with it removed, the output is 2.

So, I suppose that is the explanation, the mouse setup isn't being detected properly, although it is still able to receive input from that third button, and it does works fine when we know that there is a third button (as on the mouse).
« Last Edit: 12. November 2009, 08:22:00 pm by Pathogen » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 13. November 2009, 12:45:36 am »

Would you mind, reporting that to the LWJGL guys in their forum? Possibly they will have to forwad that to the JInput folks. But they should know about it.

Marvin
Logged
Pathogen
Just dropped in

Offline Offline

Posts: 8


View Profile
« Reply #4 on: 15. November 2009, 03:23:05 am »

Well, I've tracked the problem a little further, with some help at the LWJGL forums. The problem is with the windows library they use to detect mouse buttons, which only reports 2 on my system.

Was easy enough to check in python:
Code:
>>> from ctypes import *
>>> print windll.user32.GetSystemMetrics(43)
2
>>>

As a possible fix, should jagatoo check that the id of the mouse button on a click matches with the number it has reported? And then increase the number of detected buttons? The whole chain of dependencies are able to handle the click from the third button, even though none know about it. I haven't poked around that code enough to know what could be done, though I might have time for that later.
« Last Edit: 15. November 2009, 03:27:32 am by Pathogen » Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #5 on: 15. November 2009, 04:12:48 am »

I can try to add a fix for that later.

Marvin
Logged
gbrinon
Just dropped in

Offline Offline

Posts: 24



View Profile
« Reply #6 on: 25. May 2010, 11:48:32 am »

Hello,

I have the same problem.
I tried to check my mouse's driver but it seem the be the last one.

Maybe there's something i can do in my code to force the number of button ? (just to wait for a real solution)
Logged

Guillaume
HEMERA project on XITH3D
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #7 on: 27. May 2010, 02:10:15 am »

Wasn't there a fix in the newer LWJGL, that we're using? Could you please try to use the very latest LWJGL, if we do not yet? I don't have time to deal with it atm.

Marvin
Logged
gbrinon
Just dropped in

Offline Offline

Posts: 24



View Profile
« Reply #8 on: 27. May 2010, 10:49:14 am »

I updated SVN today. I'm already using the last version of all libraries.
I'm currently looking for a trick to make windows belive that i have a 3button mouse  Undecided
For waiting
Logged

Guillaume
HEMERA project on XITH3D
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic