Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  
  AWTEventListener + MOUSE_WHEEL_EVENT  (Read 998 times)
0 Members and 1 Guest are viewing this topic.
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Posted 2004-12-15 14:53:39 »

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.  Cry

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 )

:: JOODE :: Xith3d :: OdeJava ::
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-12-15 20:09:00 »

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.

Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #2 - Posted 2004-12-16 09:26:23 »

Thanks !!

I don't think HIAL supports the mouse wheel, but LWJGL does   Cheesy  -> I'll try LWJGL now.

:: JOODE :: Xith3d :: OdeJava ::
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #3 - Posted 2004-12-16 10:51:22 »

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 Angry :

#
# 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(TM) 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  Embarrassed

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-12-16 18:40:46 »

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.

Offline arne

Senior Devvie




money is the worst drug- we should not let it rule


« Reply #5 - Posted 2004-12-17 09:12:38 »

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. Cry

:: JOODE :: Xith3d :: OdeJava ::
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.

rwatson462 (32 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!