News:

ポストを行うにはアカウントの登録を行ってください
Please register account, if you want to post.

Main Menu

C++: dxtory key hooks not reacting to SendInput

Started by niv, March 05, 2016, 12:27:18 AM

Previous topic - Next topic

niv

Hey,

I'm trying to get dxtory to react to keys emitted via SendInput(). (Background: mapping the xbox guide button to screenshot).

Relevant code snippet:


INPUT inp;
inp.type = INPUT_KEYBOARD;
inp.ki.wScan = MapVirtualKey(44 /*PRINTSCR*/, MAPVK_VK_TO_VSC);
inp.ki.wVk = 0;
inp.ki.time = 0;
inp.ki.dwExtraInfo = 0;
inp.ki.dwFlags = KEYEVENTF_SCANCODE;

SendInput(1, &inp, sizeof(inp));

std::this_thread::sleep_for(std::chrono::milliseconds(50));

inp.ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_SCANCODE;
SendInput(1, &inp, sizeof(inp));


Other, regular keys are sent just fine to apps like notepad; however any DirectInput as well as dxtory seems to not see those events.

Any idea what's wrong?

Takedown

Using Windows 10 ?  Try the latest version first http://exkode.com/dxtory-downloads-en.html