0

I'm a linux geek. In linux I can use the event interface to read queued spontaneous gamepad events and be pretty well guaranteed not to miss events as long as I read the queue frequently enough. Obviously I then subclass and implement virtuals as callbacks for when joystick events are received.

I've recently been asked to port a QT application from linux to mingw and to support "reliable" gamepad button button-press and button-release events. All I can find in the win32 API is polling of current gamepad status, which is really sloppy. Even with a high frequency reader I could miss button events, which is not acceptable.

Can anyone point me to a win32 API primer that describes true event reception of the gamepad input? Based on what I've read, it seems that in the windows world the only interface is polling based.

Appologies if this question considered outside of reasonable scope, but I'm not a windows programmer and cannot determine whether windows goes beyond simple polling, easily.

  • If it's a Qt application, why don't you use [Qt Gamepad](https://doc.qt.io/qt-5/qtgamepad-index.html)? – ssbssa Dec 26 '17 at 16:32
  • @ssbssa - appreciate the comment. The issue I run into is upgrade hell. I'm trying to do this with minimal exposure to upgrade requirements. I'm still running Fedora 24 on the dev box and that means I have mingw-qt5.6.0 available. I'll check to see if qt-gamepad goes back to 5.6.0 –  Dec 26 '17 at 16:49
  • @ssbssa - after reviewing the QGamepad class I don't believe it is suitable for my needs. It (may) handle event driven reception (without testing I wouldn't know) but they made assumptions about the device that they shouldn't have. It expects gamepads of a fixed number of axis and buttons rather than passing a button or axis number in the generated signals and letting higher level classes decide what transducer was responsible. –  Dec 28 '17 at 17:33
  • When you are talking about polling of current gamepad status, are you talking about [joySetCapture()](https://msdn.microsoft.com/en-us/library/windows/desktop/dd757114.aspx)? – ssbssa Dec 28 '17 at 18:58
  • No. I'm aware of joySetCapture, but the structs it works with (in conjunction with a wndProc()) are designed to handle very primitive joysticks of only a single axis and up to four buttons, not an xbox360 gamepad with eight individual axis, and 8ish buttons...unless M$ documentation isn't adequately explaining how the generated messages can be used. –  Dec 29 '17 at 19:40
  • This is pretty much a non-issue now as I've adopted the "pure linux" approach. The uevent interface in linux lets me receieve the events and dispatch then via virtual methods, so it works now...I'll digress at this point and not go into any rants about the M$ platform. –  Feb 19 '18 at 20:02

0 Answers0