Skip to content

Commit

Permalink
support to turn locks off by renaming executable
Browse files Browse the repository at this point in the history
Example:
* numlock.exe -> NumLock On
* numlockoff.exe -> NumLock Off
  • Loading branch information
myfreeer authored Aug 18, 2017
1 parent c110b93 commit 81ac7b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion numlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
selfName[i] = tolower(selfName[i]);
//MessageBox(NULL, selfName, NULL, MB_OK|MB_ICONINFORMATION);

if (strstr(selfName, "off") || strstr(selfName, "un"))
bState = !bState;
if (strstr(selfName, "num"))
SetKey(bState, VK_NUMLOCK);
if (strstr(selfName, "caps") || strstr(selfName, "capital"))
Expand All @@ -50,4 +52,4 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
SetKey(bState, VK_SCROLL);

return 0;
}
}

0 comments on commit 81ac7b7

Please sign in to comment.