• Advertisement

Archived

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

WM_MOUSEMOVE problems

This topic is 6065 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

I seem to be having a problem with this event in that it only seems to occur when some other mouse even fires, like a mousedown\up etc. Is there any way I can get a continual stream of mouse x,y''s from win32 without using directinput? I''ve been reading around and some API mention the mouse being ''captured''. I''m used to capturing devices in DI but is this something you can do in win32 calls as well? Comments? Many thanks

Share this post


Link to post
Share on other sites
Advertisement
Yes, the WM_MOUSEMOVE message is passed to the WndProc everytime the mouse moves over a given window, so long another window hasn''t captured the mouse. WM_MOUSEMOVE is not dependant on whether or not the mouse has clicked on the window.

Share this post


Link to post
Share on other sites
If you hide the cursor you can move the cursor back to center of the screen when it moves near the window border. Then you have a continual stream of mouse x,y''s.



Zeblar Nagrim, Lord of Chaos

Share this post


Link to post
Share on other sites
Yep, the way you guys are talking makes me think I was right about expecting a stream of updates when the mouse moves. I''m not getting the stream however.

  
case WM_MOUSEMOVE:
{
NewEvent.Type = MOUSE_MOVE;


This however doesn''t fire until I click however. And it -ONLY- fires when a mouse button is held down. Once I release the button I get no events firing, as in set a breakpoint in the event and it never gets tripped while the mouse is moving.

My keyboard events are firing fine, my mouse clicks work fine but this only fires when the mouse is down...

Many thanks for any idea''s on resolving this...

(As a matter of interest my WM_SIZE also doesn''t fire when I resize the window...humm...)

Share this post


Link to post
Share on other sites
quote:


My keyboard events are firing fine, my mouse clicks work fine but this only fires when the mouse is down...




You should register the click position when a WM_LBUTTONDOWN message is fired and do the action when WM_LBUTTONUP message is fired.

Share this post


Link to post
Share on other sites
I don''t want to have to wait for mouse clicks to recieve WM_MOUSEMOVE events. I want a continuous stream suitable to be used for orientation control in a 3D world, ala a 3d shooter.

I''m already doing translation in to delta''s that i can feed in to my camera transformation matrix. I just need a reliable feed of data.

Chris Brodie
http:\\fourth.flipcode.com

Share this post


Link to post
Share on other sites
Zeblar. I reread your post and understand the confuction. What I mean in the post you read was that while i have the mouse button down i get a continuous stream of WM_MOUSEMOVE''s but not when I''m not holding the mouse button''s(as in either) down. If you''ve ever used a Glut demo(most of them anyway) you know the feeling, you have to hold a mouse button down to rotate objects, normal mouse movement doesn''t seem to be detected event when the mouse is over my application when it''s window is forground and active.

Chris Brodie
http:\\fourth.flipcode.com

Share this post


Link to post
Share on other sites
I don´t really understand your problem. You want to click on a 3D object and then rotate or move it until the user press the button a second time? To do so, just have a bool member that indicate if the object have been clicked or not. Then when the user move the cursor you rotate/move the object according to the new movement. I suggest you hide the cursor to indicate that a object have movement/rotation focus.



Zeblar Nagrim, Lord of Chaos

Share this post


Link to post
Share on other sites
No. Imagine trying to write a quake and using WM_MOUSEMOVE to control the ''looking around'' with the mouse.

Now my problem is, (in the quake context) my movement only occure when I have the mouse button held down. When I''m not holding the mouse button down I seem to get no WM_MOUSEMOVE events.

Share this post


Link to post
Share on other sites

  • Advertisement