1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| //*********************************************************
// Sets a button to down state
static void SetInputDX(WORD input_code_set)
{
INPUT inp[1];
memset(inp,0,sizeof(INPUT));
inp[0].type = INPUT_KEYBOARD;
inp[0].ki.wScan = input_code_set;
SendInput(1, inp, sizeof(INPUT));
}
//*********************************************************
// Sets a button to up state
static void ReleaseInputDX(WORD input_code_release)
{
INPUT inp[1];
memset(inp,0,sizeof(INPUT));
inp[0].type = INPUT_KEYBOARD;
inp[0].ki.dwFlags |= KEYEVENTF_KEYUP;
inp[0].ki.wScan = input_code_release;
SendInput(1, inp, sizeof(INPUT));
} |
Partager