How to detect a gamepad button press on OSX 10.5 and higher?

Posted by Steph Thirion on Stack Overflow See other posts from Stack Overflow or by Steph Thirion
Published on 2010-02-10T04:12:36Z Indexed on 2010/05/28 1:31 UTC
Read the original article Hit count: 263

Filed under:

How do I detect a button press on a USB gamepad on OSX 10.5 and higher?

I can't wrap my head around the ridiculously complex HID Manager (even though apparently it was simplified with 10.5), and the code samples at Apple have thousands of lines of code that would take days to understand and isolate what I need, so I'd appreciate if someone posts a simple, and fully coded solution for this isolated problem.


EDIT: so far all answers are links to source code or semi obscure libraries for all kinds of HID devices, which will require more research time than what I'd like to invest on this. I am starting a bounty to get an actual snippet of code that solves this simple problem (using an external library or not).


EDIT POS BOUNTY: thanks to all for you help; but unfortunately the answer that has been automatically selected by the system is not working for me, can't figure out why; and the author has not yet replied to my comments. Any insight would be appreciated, but until a fix is found, anyone looking for resources on this topic should take this answer with a pinch of salt.

© Stack Overflow or respective owner

Related posts about cocoa