Reputation: 4485
Question in the title is quite precise.
I need to generate certain key events in my app, so OS can handle them as "normal, user" key presses. How to deal with that in Qt? Is there any neat way to solve this problem?
Upvotes: 0
Views: 1486
Reputation: 6532
You can simulate Windows keyboard presses using the Win API function keybd_event
, e.g.:
#include "windows.h"
keybd_event(VK_RETURN, 0, 0, 0);
keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
Upvotes: 3