WM_MOUSEMOVE

Started by
3 comments, last by shumik 18 years, 6 months ago
WM_MOUSEMOVE can only provide an event where mouse is moved and either shift button pressed or a mouse button clicked at a time. But I need all three: to create an event where Mouse is moved, a mouse button is clicked and a shift is pressed. What should I do? Thanks
Advertisement
Is WM_LBUTTONDOWN what you're looking for?
one..
I think i wasn't very clear to explain what i want. sorry.
I need to be able to do the following:
Suppose there is an object on the screen, I click on it with left mouse button, i press the shift key, and while holding left mouse button and shift key together - i move the mouse, so that a clone of this object is created and dragged. So it's all 3 events together: mouse is moving, button is clicked and a key is pressed. WM_MOUSEMOVE can only give you 2 events: moving mouse and pressing shift, or moving mouse and clicking a mouse button, but not all three at the same time. I need all three of them at the same time.
Well, In that case you could do something like this:

WM_LBUTTONDOWN :bool bool_lbuttondown = TRUE;....WM_MOUSEMOVE :if ( bool_lbuttondown && (wParam == MK_SHIFT) )     // all three events happend
one..
Thanks for the hint!
I figured out the problem with the following code

//global variable
bool ShiftLClickDown = false;
LRESULT WINAPI MsgProc(...)
//Buttons DOWN
case WM_LBUTTONDOWN:
{
switch (wParam)
{
case 5: //5 stands for Shift
ShiftLClickDown = true;
break;
//you can add more cases here for CTRL and other buttons

}
break;
}

case WM_MOUSEMOVE:
{
//shift is down + move + lclick
if (ShiftLClickDown)
{
printf("triple event here!\n");
break;
}
....

This topic is closed to new replies.

Advertisement