Skip to content

Instantly share code, notes, and snippets.

@usagi
Created January 9, 2014 23:02
Show Gist options
  • Select an option

  • Save usagi/8343773 to your computer and use it in GitHub Desktop.

Select an option

Save usagi/8343773 to your computer and use it in GitHub Desktop.
#include <rtccore.h>
#include <WonderRabbitProject/key.hxx>
int main()
{
for(auto n = 3; n; --n)
{
std::cerr << n << "\n";
Sleep(1000);
}
auto kh = WonderRabbitProject::key::key_helper_t::instance();
INPUT input;
input.type = INPUT_KEYBOARD;
input.ki.wVk = kh.code("s");
input.ki.wScan = MapVirtualKey(input.ki.wVk, 0);
input.ki.dwFlags = KEYEVENTF_EXTENDEDKEY;
input.ki.time = 0;
input.ki.dwExtraInfo = ::GetMessageExtraInfo();
SendInput(1, &input, sizeof(INPUT));
input.ki.dwFlags |= KEYEVENTF_KEYUP;
SendInput(1, &input, sizeof(INPUT));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment