exebook
exebook

Reputation: 33890

Get mouse buttons state being in background

I need something like GetKeyboardState() but for mouse. I do not need to handle an event when the mouse button pressed, just need to know if the buttons are up or down at some moment. This is for toy animation program.

Upvotes: 1

Views: 79

Answers (1)

Jonathan Potter
Jonathan Potter

Reputation: 37122

if (GetAsyncKeyState(VK_LBUTTON) < 0)
{
    // left button is down
}
if (GetAsyncKeyState(VK_RBUTTON) < 0)
{
    // right button is down
}

Upvotes: 3

Related Questions