Answer the question
In order to leave comments, you need to log in
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
And no one was surprised that the task is being solved in console mode and the answer here is more than obvious?
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.
dig towards RegisterHotKey. here, for example, www.cplusplus.com/forum/windows/47266
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question