M
M
mashacppjun2015-07-26 15:48:23
Windows
mashacppjun, 2015-07-26 15:48:23

How to track the state of a mouse button?

int main() {
CheckMouseButtonStatus();
system("pause");
return 0;
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
Zelimkhan Beltoev, 2015-07-26
@Beltoev

And no one was surprised that the task is being solved in console mode and the answer here is more than obvious?

D
dordzhiev, 2015-07-26
@dordzhiev

If you are working with WinAPI, then in such cases it is usually worth starting with MSDN . It almost always says why it doesn't work.

The key status returned from this function changes as a thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function to retrieve that information.

V
void_programmer, 2015-07-26
@void_programmer

dig towards RegisterHotKey. here, for example, www.cplusplus.com/forum/windows/47266

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question