• Advertisement

Archived

This topic is now archived and is closed to further replies.

capturing mouse movement outside window

This topic is 5810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I am writing a program as a console (non-win32 app), and I am wondering how to capture mouse movement when the mouse is not in the window. You see, I am writing a very simple 3D shooter and I want to capture when the mouse moves left or right. Right now, if the mouse cursor moves out of the window, openGL will stop registering mouse motion events. I think capturing mouse motion outside the window has something to do with glutEntryFunc(). I know that if i were using a win32 app, i could use getCursor()... is there a way to do that in a non-win32 app using glut? thanks, Rizwan

Share this post


Link to post
Share on other sites
Advertisement
opengl was NOT designed for input hence you cant do this. make your window fullscreen.

glut is a poor excuse for portable methods of dealing with a windowed gui enviroment (ie win9x, X). whether you like it or not, if it runs in windows, its a win32 app. the choice you make for the project simply tells vc++ how to deal with the code you supply (ie you can create a full blown windows app from a console projectm just like you can create a console project from a "win32 app" project).

if this is trully a non win32 app that is running in X, look up X stuff, and you should be all good (i dont know how X handles capturing mouse input).

Share this post


Link to post
Share on other sites
Maybe SDL allows you to do this? It has a lot more functonality than GLUT. http://www.libsdl.org/

Share this post


Link to post
Share on other sites
If you can get the hWnd for your GLUT window (someone posted this the other day) then you should be able to call SetCapture.
This will only work outside your window while you have a mouse button pressed.



Slightly shrimpy smell == unsafe breadbin

Share this post


Link to post
Share on other sites
simple 3d shooters dont let the mouse move out of the window

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You may want to try DirectInput in DirectX. You can obligate the mouse to send all its input to your program at that point (IF you are programming in Windows - I assume everyone uses Windows, I forget that sometimes!)

Share this post


Link to post
Share on other sites

  • Advertisement