|
LRESULT CALLBACK LLKeyboardHookCallbackFunction(
int nCode, WPARAM wParam, LPARAM lParam)
{
DWORD VkCode = 0;
DWORD KeySts = 0;
VkCode = (((KBDLLHOOKSTRUCT*)lParam)->vkCode);
KeySts = wParam;
if (VkCode == VK_TAB)
{
if (KeySts == WM_KEYDOWN || KeySts == WM_SYSKEYDOWN)
//Generate the keyboard press event of the mapped key
keybd_event(VK_UP, 0, 0, 0);
if (KeySts == WM_KEYUP || KeySts == WM_SYSKEYUP)
//release the mapped key
keybd_event(VK_UP, 0, KEYEVENTF_KEYUP, 0);
return 1;
}
//let default processing take place
return CallNextHookEx(g_hInstalledLLKBDhook, nCode,
wParam, lParam);
}
|
|