keybd_event
is actually not Qt function, but part of Windows Api.
Both keybd_event
and SendInput
allow you to send press event and release event. If you want to send combination ctrl+A
you should send events as follows:
press Ctrl -> press A -> release A -> release Ctrl
If you want to use keybd_event
, you need to call it 4 times subsequently, if you want to use SendInput
, you can make an array of 4 events.
You should use keyboard codes from Windows API to simulate keyboard events, while Qt's codes may coincide with Microsoft's.
Also you should understand that this solution has nothing to do with Qt, it Windows specified.
You just found all links to docs you would need, I think you should start studing it and ask more concrete questions, if you would have any problems.