Mouse click problems

I'm using GetAsyncKeyState() to check if the mouse is clicked.
However ,it doen't detect clicks when the mouse is moving.
Anyone knows a better alternative?

1
2
3
4
  if(GetAsyncKeyState(VK_LBUTTON) & 0x8000)
  {
  //left mouse button pressed
  }
try this

1
2
3
4
if(GetAsyncKeyState(VK_LBUTTON))
  {
  //left mouse button pressed
  }


I don't know if removing the bitwise AND makes a difference, but I suppose it's worth a try.
Topic archived. No new replies allowed.