PDA

View Full Version : mouse help



jono_123
06-11-2002, 10:56 PM
im using glut and all i can do right now is get the x and y position of the cursor on the screen but when the cursor is on the very right hand side of the screen and i move the mouse to right even more it wont pick that up and i need to pick up that movement
any ideas?

Gavin
06-12-2002, 12:37 AM
What you are asking for is pretty much impossible i think, If you are using this for some sort of motion, why not just continue the last motion while the mouse is at the screen extremeties, or slightly speed it up over the last few pixels at the extremeties?

AndrewJJ
06-12-2002, 03:17 AM
Nothing's impossible ! ... well maybe ?

Your problem is a very common one that can be easily resolved ... using DirectInput is one that's possible but what I do is to maintain the cursor at the form's center - so read the cursor's position and then move it back to the center ... GetCursor and SetCursor !

Andrew http://www.opengl.org/discussion_boards/ubb/redface.gif)

zen
06-12-2002, 03:55 AM
An other approach is to warp the pointer only if it hits the edge of the window.This way you need less cursor warps which results in less overhead.I don't think it'll make a big difference though(it does make under linux and X11 for other reasons).

rhmazza
06-12-2002, 05:22 AM
Is there any way to change the position of the cursor with platform-independent calls?

coredump
06-12-2002, 05:36 AM
Is there any way to change the position of the cursor with platform-independent calls?

i don't believe so.

FYI: in the glut source code, glutWarpPointer is just a wrapper for SetCursorPos in WIN32 and XWarpPointer on un*x machines.

b

[This message has been edited by coredump (edited 06-12-2002).]

zen
06-12-2002, 11:13 AM
If you want platform independency you should use some cross-platform library to do it for you,like SDL or glut.

jono_123
06-12-2002, 08:55 PM
how do you set the cursor position in glut?



Originally posted by AndrewJJ:
Nothing's impossible ! ... well maybe ?

Your problem is a very common one that can be easily resolved ... using DirectInput is one that's possible but what I do is to maintain the cursor at the form's center - so read the cursor's position and then move it back to the center ... GetCursor and SetCursor !

Andrew http://www.opengl.org/discussion_boards/ubb/redface.gif)

06-13-2002, 02:56 AM
glutWarpPointer http://techpubs.sgi.com/library/tpl/cgi-...glutWarpPointer (http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=fw&db=man&fname=/usr/freeware/catman/u_man/cat3/glutWarpPointer.Z&srch=glutWarpPointer)

jono_123
06-15-2002, 12:12 AM
i've got it http://www.opengl.org/discussion_boards/ubb/smile.gif
thanx for eveyone's help