Skip to main content
gamedev.net
🔒 Locked

Win32 help

Started by Agincourt 2 replies 600+ views
Original Post
Agincourt
Agincourt
I have a directx8 app that I need to incorporate edge scrolling into with the mouse. I am using the standard windows message WM_MOUSEMOVE and then testing the lparam for x and y values. My question is: I can detect if the mouse moved to the edge but how do I get it to keep moving and updating the screen, because once I get to the edge the mouse stops moving, and windows no longer sends the WM_MOUSEMOVE message. my code is as follows - switch(msg){ case WM_MOUSEMOVE: { int Xloc=LOWORD(lparam); int Yloc=HIWORD(lparam); if(Xloc>=g_width-1) { xpos++; SetView(xpos,ypos,zoom,offset); } if(Xloc<=0) { xpos--; SetView(xpos,ypos,zoom,offset); } if(Yloc>=g_height-1) { ypos--; SetView(xpos,ypos,zoom,offset); } if(Yloc<=0) { ypos++; SetView(xpos,ypos,zoom,offset); } break; } Is there any way to just find the x and y coords of the mouse without dealing with the message system? preferably without having to incorporate DirectInput(which I could do, but seems a little excessive when all I need is x,y coords)-Thanks Use the WriteCoolGame() function Works every time
Use the WriteCoolGame() functionWorks every time
Shannon Barber
Shannon Barber
Direct Input?

Magmai Kai Holmlor
- The disgruntled & disillusioned
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
FordPrefect
FordPrefect
Windows will only send WM_MOUSEMOVE when the cursor position has changed, and since it can''t move any farther in one direction when it''s at the screen edge, moving the mouse in that direction wont generate any WM_MOUSEMOVE messages. My advice would be to scroll the view until the user moves the mouse away from the edge.
baskuenen
baskuenen
I think you''re looking for mouse capturing. Once captured, it will keep sending MOUSEMOVE messages to the window that captured it. Even if it moves outside of the window.

Win32, SetCapture() will do the trick.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.