low level keyboard hook
Im making a simple logger that logs the amount of key pressed, and the amount of mouse clicks.
I got my hook working, and all the keys are being logged, but i dont know how to log the mouse clicks:S
I tried the following:
The keystroke counts up just fine.
I got my hook working, and all the keys are being logged, but i dont know how to log the mouse clicks:S
I tried the following:
Code:
LRESULT CALLBACK keyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam){
PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) lParam;
if (nCode==HC_ACTION){
if (wParam == WM_KEYDOWN){
switch (p->vkCode)
{
case VK_LBUTTON: cout << l++ << endl; break;
case VK_MBUTTON: cout << m++ << endl; break;
case VK_RBUTTON: cout << r++ << endl; break;
default: cout << keystroke++ << endl;;
}
}
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}

