Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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  
  RFE: Mouse cursor control  (Read 4699 times)
0 Members and 1 Guest are viewing this topic.
Offline abies

Senior Duke





« Posted 2003-07-27 07:30:43 »

I know that this is not exactly 'input', but would it be possible to add some kind of mouse cursor control to jinput ? In fact, single method for setting mouse coordinates would be enough. If we could control mouse cursor shape (mainly for disabling it), it would be great.

I'm thinking about implementing mouse look - but to do this, I need to recenter mouse cursor every frame. I can use java.awt.Robot, but I would like to minimize dependencies on awt toolkit.

Artur Biesiadowski
Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #1 - Posted 2003-07-27 14:25:39 »

I'm going to have to oppose anything more than turning off the cursor because it doesn't fall under the realm of device input. The mouse itself receives no special treatment under JInput, it being just one of many devices that get enumerated.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #2 - Posted 2003-07-27 20:42:52 »

I agree.. in fact I would put the pointer hiding into JOGL, even though it isn't OpenGL it IS more display-oriented.  If you aren't using JOGL then AWT already has the ability, and I think so does LWJGL.

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

Senior Duke





« Reply #3 - Posted 2003-08-02 09:58:38 »

Ok, let's forget about cursor hiding - my main RFE was about ability to set mouse cursor coordinates. IMHO this is a realm of device input, in same way as force feedback.

Artur Biesiadowski
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-08-02 10:23:23 »

Hi
 sort of, but my response would be that the decive (mouse) doesn't give screen position, it gives movement relative to where it was, so, it might be logical to allow you to move the mouse by a certain amount (don't read pixels here, mice know nothing about them), but not to set a position. Screen positions and pixels are somrthing that the GUI knows about.

Cheers

Endolf

Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #5 - Posted 2003-08-02 16:23:28 »

Ditto. This is something that the application would have to setup. The JInput system can tell you in relative terms where/how the mouse is moving, but it actually has no idea where it is.

You may be misunderstanding the concept of what the API does. JInput is just telling you what happened - its not changing the state of anything on the screen. If you're using JInput, you're not controlling the 'Java native mouse pointer' but instead some other pointer representation you're drawing yourself - similar to what you would have to do with LWJGL back in 0.6, though I believe they've done some work for peeking/poking the native cursor. All you're getting from JInput are offsets - what you do with those offsets, button presses, etc are up to you.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #6 - Posted 2003-09-16 11:15:43 »

Quote
Ditto. This is something that the application would have to setup. The JInput system can tell you in relative terms where/how the mouse is moving, but it actually has no idea where it is.

You may be misunderstanding the concept of what the API does. JInput is just telling you what happened - its not changing the state of anything on the screen. If you're using JInput, you're not controlling the 'Java native mouse pointer' but instead some other pointer representation you're drawing yourself - similar to what you would have to do with LWJGL back in 0.6, though I believe they've done some work for peeking/poking the native cursor. All you're getting from JInput are offsets - what you do with those offsets, button presses, etc are up to you.


So, what's supposed to happen with things like graphics tablets?

E.g. if tablet is in absolute-mode, what data will JInput provide to the app? (At the moment WACOM tablets on several platforms are only supported in absolute-mode...although there are OS projects to try and provide drivers that enable the relative mode too - I hear it's a pretty simple change!)

Obviously, if tablet is in relative mode, then the driver is going to deliver mouse-like relative events, so no problem there...

If I get any free time soon, I'll experiment with my WACOM tablets and let you know what actually happens Smiley, but it could be a long time before then Sad

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #7 - Posted 2003-09-16 13:34:01 »

Good question.. in fact I just bought a Wacom tablet for my powerbook and forgot completely that I should see what JInput has to say about it.

I suspect that the tablet will show up as a device with 2-3 axis and a few buttons and that the values returned for each will be straightforward.
x & y axis will return the x & y position of the pen - assuming the device always returns absolute co-ordinates and the OS manipulates these to provide a relative "mouse" cursor.

I would guess a third axis, not sure what it will be called (z?), will likely return the pen pressure.  And buttons are simple enough.

Although a tablet is not really a gaming device.. so maybe support will be limited in JInput if it is going to take too much effort to make it work right.  I'm betting it won't be much trouble though.

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #8 - Posted 2003-09-16 14:32:35 »

Hi
 Under the linux version at least, if the device reports having absolute axes then absolute values will be reported to jinput, and the type of axis can be obtained from jinput. I've not tried one to test it, as I don't have access to one.

Will be interested to see what happens

Cheers

Endolf

Offline JuddMan

Senior Duke


Medals: 1


Your Ad Here


« Reply #9 - Posted 2003-09-23 18:48:25 »

i noticed that the mouse movement is shown on the axis the same as the joystick, either a 1,0 or -1

is there a way of actually determining the amount the mouse moved since the last poll?

edit:

i also noticed that having 2 mice (USB and ps2) plugged in didnt make a diference to the number of devices detected. i assume mice are reported as a single device by the OS
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #10 - Posted 2003-09-23 19:35:55 »

Quote
i noticed that the mouse movement is shown on the axis the same as the joystick, either a 1,0 or -1

is there a way of actually determining the amount the mouse moved since the last poll?


This only seems to happen with Windows/DirectX.. on the Mac I am seeing reasonable numbers.  This is only with the jinputtester app.. I haven't tried anything "real" with the mouse yet.

Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #11 - Posted 2003-09-24 17:00:44 »

In OSX, the graphics tablet is in a different HID class that doesn't even get enumerated so its highly unlikely to be supported on OSX as it would open the door to enumerating a whole host of other devices that really shouldn't be enumerated and will cause JInput to break if those devices were plugged in.

Remember, HID enumerates anything on the USB bus - so you narrow it down by category. In this case its getting anything the HID chain quantifies as a game controller. Without categories we'd be getting a whole host of strange things like UPSs, hard disks, memory card readers, etc.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #12 - Posted 2003-09-24 17:47:51 »

Quote


This only seems to happen with Windows/DirectX.. on the Mac I am seeing reasonable numbers.  This is only with the jinputtester app.. I haven't tried anything "real" with the mouse yet.


linux reports the amount moved too, I beleive Jeff has this on his work list, but it's a long list. I'm in the US on a training course atm, then i'm moving, maybe i'll take a look at it after that if it's not changed.

Endolf

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #13 - Posted 2003-09-24 21:25:43 »

Quote
Remember, HID enumerates anything on the USB bus - so you narrow it down by category. In this case its getting anything the HID chain quantifies as a game controller. Without categories we'd be getting a whole host of strange things like UPSs, hard disks, memory card readers, etc.


But but but.... HID stands for Human Interface Device....
UPSs, HDs, memory cards, etc. have no business being enumerated by HID... sigh....

Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #14 - Posted 2003-09-25 13:59:15 »

Don't shoot the messenger - I didn't write it  Grin

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #15 - Posted 2003-09-25 15:19:29 »

Yeah, I know  Smiley

So are you saying that there is basically no easy way to pick out all of the USB devices that are truly HIDs?  You would figure that the USB guys would have built that into the USB HID spec somehow.

I feel like filing a bug with Apple for being bone headed...

Offline Jeff

JGO Coder




Got any cats?


« Reply #16 - Posted 2003-09-25 19:44:44 »

Quote
i noticed that the mouse movement is shown on the axis the same as the joystick, either a 1,0 or -1

is there a way of actually determining the amount the mouse moved since the last poll?

edit:

i also noticed that having 2 mice (USB and ps2) plugged in didnt make a diference to the number of devices detected. i assume mice are reported as a single device by the OS


Yes this is an open issue.

Shouldn't be THAT hard to fix but I'm snowed under with Sun server-side game stuff.

Do we have any volunteers?

While we're at it, it was also decided that the queuing of the KB input really wasn't the most desirable behavior.    Whoever hits the oen issue should probably hit the other.





Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #17 - Posted 2003-09-26 11:49:41 »

Hi
 I can try and take a look at the mouse values one, but the other I dunno where to start on, again, this depends on me getting my knackered old laptop to play nice with forte and jinput.

Cheers

Endolf

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.

Longarmx (49 views)
2014-10-17 03:59:02

Norakomi (38 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (34 views)
2014-10-15 16:18:58

TehJavaDev (65 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (54 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!