WM_MOUSEMOVE problems

Started by
11 comments, last by gimp 22 years, 7 months ago
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
Chris Brodie
Advertisement
yea just handle the WM_MOUSEMOVE event. look it up in the MSDN.
(http://www.ironfroggy.com/)(http://www.ironfroggy.com/pinch)
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.
-- Succinct(Don't listen to me)
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
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...)

Chris Brodie
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.
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
Chris Brodie
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
Chris Brodie
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
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.
Chris Brodie

This topic is closed to new replies.

Advertisement