The return value is 4 and I'm running Visual Studio in administrative mode so permissions should be ok. I don't see anything typed out though. Any help? I'm using Windows 7 x64.
INPUT input[4];
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = 0;
input[0].ki.wScan = 'a';
input[0].ki.dwFlags = KEYEVENTF_SCANCODE;
input[0].ki.time = 0;
input[0].ki.dwExtraInfo = 0;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = 0;
input[1].ki.wScan = 'a';
input[1].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_SCANCODE;
input[1].ki.time = 0;
input[1].ki.dwExtraInfo = 0;
input[2].type = INPUT_KEYBOARD;
input[2].ki.wVk = 0;
input[2].ki.wScan = 'a';
input[2].ki.dwFlags = KEYEVENTF_SCANCODE;
input[2].ki.time = 0;
input[2].ki.dwExtraInfo = 0;
input[3].type = INPUT_KEYBOARD;
input[3].ki.wVk = 0;
input[3].ki.wScan = 'a';
input[3].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_SCANCODE;
input[3].ki.time = 0;
input[3].ki.dwExtraInfo = 0;
int retval = SendInput(4, input, sizeof(INPUT));
if(retval > 0)
{
wxLogDebug("SendInput sent %i", retval);
}
else
{
wxLogError("Unable to send input commands. Error is: %i", GetLastError());
}