PDA

View Full Version : Joysticks and OS X...


scratt
2006-03-02, 07:50
Hello..

Has anyone got a good source of tuorials, code examples, or hints and tips for joysticks (the PS2 style USB ones) and OS X..

I cannot find any real documentation for this at Apple, or elsewhere and don't seem to be getting much from SDL or GLUT..

Any pointers would be gratefully received..

Thanx!

Brad
2006-03-02, 09:09
This may not be a lot of help, but you could try peeking through the source code from SNES9x. It takes input from USB gamepads.

http://www.geocities.co.jp/SiliconValley-PaloAlto/2560/snes9x.html

Also, from Apple, Getting Started With Games (http://developer.apple.com/referencelibrary/GettingStarted/GS_Games/index.html):

Supporting Game Devices
Device control is fundamental to all games. In MacOSX, the Human Interface Device (HID) Manager supports access to HID-class devices, such as joysticks and non-Apple displays. For access to devices that provide tactile sensation to the user, the Force Feedback framework defines a programming interface that is functionally similar to Microsoft’s DirectInput API.

If you want to use a specific Mac OS X framework to control devices that are attached to the system, read Force Feedback Device Access Reference (http://developer.apple.com/documentation/DeviceDrivers/Reference/ForceFeedback/index.html#//apple_ref/doc/uid/TP30000818) to learn about Apple’s implementation of force feedback.
If you want to know more about how to develop applications that communicate with or control HID class devices, read HID Class Device Interface Guide (http://developer.apple.com/documentation/DeviceDrivers/Conceptual/HID/index.html#//apple_ref/doc/uid/TP40000970).

scratt
2006-03-02, 09:21
Thanks Brad.. Really appreciate that.. Don't understand why I didn't find the Apple info.. Perhaps I thought the 'getting into games' thing looked too trivial!:o

Brad
2006-03-02, 09:25
Heh, don't feel bad. I didn't even browse through Apple's site. I just searched Google for site:apple.com HID "Mac OS X".

scratt
2006-03-02, 09:29
You mean I don't have to stand in the corner any more? ;) :D