Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

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";
share|improve this question

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
It is more like I am trying to press keys via xbox controller – Outlaw Lemur Jul 8 '12 at 12:52
@OutlawLemur, see my edited answer. – druciferre Jul 8 '12 at 18:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.