Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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  
  360 degree continuous mouse movement  (Read 1339 times)
0 Members and 1 Guest are viewing this topic.
Offline sTyLeS

Senior Newbie




Ooga friggin Booga!!


« Posted 2004-05-11 19:43:59 »

How does one register continuouse mouse movement in one direction?
For example: A simple raycasting game where one can pivot in place and view the world in 360 degrees using the mouse. Using MouseMotionListener, I believe MouseEvents stop being sent once the edge of the "screen" is hit, but for my usage I would like to know that the mouse is still being rolled in the same direction.
Is there anyway to determine this? I remember back when using C/C++ and Allegro there was a notion of "mickeys" which was independent of the screen's X,Y coordinates of the cursor, but was rather a delta of the mouse's motion. Anything like that, or a way to determine that?
Thanks a lot!
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2004-05-11 19:52:10 »

JInput could give you this. Or you could use a java.awt.Robot to reset the mouse position each frame and just record the difference from the center position.

Kev

Offline sTyLeS

Senior Newbie




Ooga friggin Booga!!


« Reply #2 - Posted 2004-05-11 20:12:43 »

Thank you so much for the quick response, kevglass. I went ahead and implemented the java.awt.Robot solution you had suggested. Just resetting the cursor every frame, and upon movement determine current relationship to the center. Works like a charm. Thanks a lot!

(However, it does seem sort of like a backwards way to get the required data.)
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.

CopyableCougar4 (3 views)
2014-08-01 19:37:19

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36

Riven (46 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
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!