We had troubles using it first. We also referred to many other samples on the Internet. But still it was not clear that after sending every keystroke we must also send the same keystroke with the KEYEVENTF_KEYUP flag to indicate that the key is released.
Basically, to type the character ‘A’, you would need to fill in 2 INPUT structures, one for pressing (without KEYEVENTF_KEYUP flag) and another for releasing (with KEYEVENTF_KEYUP flag).
So for example, if you want to simulate Shift+A, the array of INPUT structures would be as follows.
Hope this helps somebody out there.