AWTEventListener + MOUSE_WHEEL_EVENT

Hi

I’ve got the following problem (i don’t know if it’s correct to put it here) :

I want to use my mouse wheel to zoom in and out in my game. To do that I added a new AWTEventListener, but this EventListener does only sometimes receive mouse wheel events. And when it does, it receives all at once (At least it looks like it). Can anybody help me? It really sucks. :’(

Thanks in advance.
Arne

PS: I don’t add it to the Canvas3D directly, because I have something around of the Canvas3D and I want to have the events there too.

Edit: I’ve noticed that the Events are only caught, when I rotate the mouse over an JTree (one of the stuff around the Canvas3D) ( it still happens late there - like if the events are only processed every second )

AWT events pretty crap most of the time. I found that the frequency that events are fired makes for very jagged input.

I am using LWJGL as my renderer of choice now, with HIAL for input. LWJGL gets the mouse data directly from the mouse when I want it (i.e. every time I poll, which is every frame). It is far more superior to anything AWT can offer (although perhaps not suited to your application by the sound of it).

Will.

Thanks !!

I don’t think HIAL supports the mouse wheel, but LWJGL does :smiley: -> I’ll try LWJGL now.

mmpf…

if I use LWJGL for the input, I also have to use LWJGL for rendering. This shouldn’t matter, because I’m using xith, but when I switch to LWJGL (simply changing the import) I get the following HotSpot Error >:( :

An unexpected error has been detected by HotSpot Virtual Machine:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x5f0d3d04, pid=3548, tid=3992

Java VM: Java HotSpot™ Client VM (1.5.0-b64 mixed mode, sharing)

Problematic frame:

C [OPENGL32.dll+0x3d04]

An error report file with more information is saved as hs_err_pid3548.log

If you would like to submit a bug report, please visit:

http://java.sun.com/webapps/bugreport/crash.jsp

NOTICE: GL_EXT_vertex_shader disabled because of missing driver symbols
NOTICE: GL_ATI_vertex_streams disabled because of missing driver symbols

maybe I’m going to use JInput, but it looks pretty complicated for me :-[

Arne

Don’t use the xith3d bundled win32 lib, it is out of date.

I have been waiting for a new LWJGL release to update it and there was one yesterday (I havn’t done it yet though).

As for HIAL Wheel support -> since you are using it, how do you recommend I do it? Just wheelUP wheelDown?

Will.

In lwjgl and AWT they use an int which counts the ticks the mouse wheel was rotated. A positive value means rotation upwards, a negative one downwards or vice versa.

Arne

Edit: I’ve checked the source of HIAL and I don’t see why the AWT event’s shouldn’t crap there. I’ve also checked the lwjgl part, and I don’t see why it should work when I don’t use lwjgl as a renderer. I cannot use lwjgl because of above. :’(