I am proficient in c++, however i know almost nothing regarding the windows api.
What i want my program to do is intercept the CAPSLOCK key and ignore it (as if it weren't pressed in the first place)
If the user presses SHIFT+CAPSLOCK it would toggle capslock on or off.
I assume the program would use some api to hook capslock and if shift was not pressed before, trash one of the key pressed flags?? I have googled and honestly have no idea how i would do this.
I have tried this, but it seems stupid and it dosen't work all the time.
bool loop1 = true;
while (true)
{
if (GetAsyncKeyState(VK_CAPITAL))
{
Sleep(15);
//Turn on Caps Lock:
keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY | 0, 0);
//Turn off Caps Lock:
keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
Sleep(15);
}
}
Thanks