Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landgrafhomyak/01d51b25955eb7560a8bfa351fd3d52d to your computer and use it in GitHub Desktop.
Save landgrafhomyak/01d51b25955eb7560a8bfa351fd3d52d to your computer and use it in GitHub Desktop.
/*
This macro allows to use CapsLock instead of Space clicker.
Recomends to set CaplsLock disabler to Shift.
*/
#include <windows.h>
void main(void)
{
INPUT ip[2] = {
{
.type = INPUT_KEYBOARD,
.ki.wScan = 0,
.ki.time = 0,
.ki.dwExtraInfo = 0,
.ki.wVk = VK_SPACE,
.ki.dwFlags = 0
}
};
ip[1] = ip[0];
ip[1].ki.dwFlags = KEYEVENTF_KEYUP;
while (1)
{
if (GetKeyState(VK_CAPITAL) != 0)
{
SendInput(2, ip, sizeof(INPUT));
}
Sleep(50);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment