Created
December 14, 2011 18:35
-
-
Save float-tw/1477860 to your computer and use it in GitHub Desktop.
用p代替滑鼠左鍵(windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
int main() | |
{ | |
int chk; | |
while(1) | |
{ | |
Sleep(1); | |
chk = GetKeyState('P'); | |
if(chk&0x80) | |
{ | |
chk = GetKeyState(VK_LBUTTON); | |
if( (chk&0x80) == 0) | |
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); | |
} | |
else | |
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment