Press a key using virtual key with SendInput
ATL / WTL / STL
1
Posts
1
Posters
0
Views
1
Watching
-
I do an example to emulate keyboard with SendInput. Here is the code to press "a" with "dwFlags = KEYEVENTF_UNICODE". Code: INPUT inp[2]; memset(inp,0,2*sizeof(INPUT)); inp[0].type = INPUT_KEYBOARD; inp[0].ki.dwFlags = KEYEVENTF_UNICODE ; inp[0].ki.wScan = "a"; inp[1] = inp[0]; inp[1].ki.dwFlags |= KEYEVENTF_KEYUP; SendInput(2, inp, sizeof(INPUT)); // Press "a" Do you know how to press "a" with dwFlags = 0 and ki.wVk = "virtual key of a" ? Thanks and regards.