i dont know why but when doing ..
keybd_event( VK_OEM_PERIOD ,0x45,KEYEVENTF_EXTENDEDKEY |0 , 0 );
keybd_event( VK_OEM_PERIOD ,0x45,KEYEVENTF_KEYUP | 0,0 );
does a > and not a .
anyone know whats the prob?
i dont know why but when doing ..
keybd_event( VK_OEM_PERIOD ,0x45,KEYEVENTF_EXTENDEDKEY |0 , 0 );
keybd_event( VK_OEM_PERIOD ,0x45,KEYEVENTF_KEYUP | 0,0 );
does a > and not a .
anyone know whats the prob?
Perhaps you got the shift state wrong?
Why are you bitwise or'ing with zero anyway?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
doing '.' does a BACKspace
Last edited by Anddos; 08-23-2006 at 12:17 PM.
The code you posted works for me in a console application. Maybe try using SendInput instead (if using Windows NT or later)? This seems to work:
Code:INPUT inpt[2] = {0}; inpt[0].type = INPUT_KEYBOARD; inpt[0].ki.wScan = '.'; inpt[0].ki.dwFlags = KEYEVENTF_UNICODE; inpt[1].type = INPUT_KEYBOARD; inpt[1].ki.wScan = '.'; inpt[1].ki.dwFlags = KEYEVENTF_UNICODE|KEYEVENTF_KEYUP; SendInput(2,inpt,sizeof(INPUT));
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
i am gonna need the includes and headers , otherwsie 26 compile errors
I am asuming that one of those errors are that the compiler doesn't recognize the INPUT structer or the SendInput() function.
Here is some advice, when you get such errors, go to your compiler's include folder, and search it's files for that function or structer. A .H file should come up. Include that one. Do the same with the compiler's lib folder, and link that .LIB file to your project settings.
>> i am gonna need the includes and headers , otherwsie 26 compile errors
BTW: Includes and headers are the same thing. (At least in your case.)