1
\$\begingroup\$

I am using an Xbox controller to send data to my computer, and am using the SendInput method to handle keys. I was wondering if there was any other, better way to do this.

INPUT Input = { 26 };
Input.type = INPUT_KEYBOARD;
Input.ki.dwFlags = VK_UP;
SendInput(1, &Input, sizeof(INPUT));
std::cout << "Up";
Adam
5,2261 gold badge30 silver badges47 bronze badges
asked Jul 8, 2012 at 2:38
\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

Are you wanting to direct this to a specific application? It's usually better to send WM_KEYDOWN and/or WM_KEYUP using the SendMessage function.

If not, then I would suggest using the keybd_event function. You can find some good examples on Code Project

answered Jul 8, 2012 at 6:00
\$\endgroup\$
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.