Game input in Cocoa - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Game input in Cocoa (/thread-6663.html)
Game input in Cocoa - aegidian - Oct 24, 2003 03:49 AM
I'm looking for some way to grab joystick/controller input for a Cocoa based game.
I'm pretty uncertain about how difficult wrapping HID manager functions with obj C classes might be, or even if it's possible.
AmelioGIL is mentioned in the FAQ but the links there are borken.
Has anyone any experiences or source-code I could lean on? Please.
Game input in Cocoa - codemattic - Oct 24, 2003 04:45 AM
Quote:Originally posted by aegidian<http://doomlegacy.idevgames.com/amelio/> works for me.
Game input in Cocoa - aegidian - Oct 24, 2003 05:03 AM
Aha - the links in the faq are capitalised and the server case-sensitive!
me go fix now!
Game input in Cocoa - MattDiamond - Oct 24, 2003 11:39 AM
I'm considering using Amelio myself. The coding side seems really sweet. But the config screen is not ideal. Also, one of the other uDG programmers mentioned that it wasn't working for all his users, though that could just be his problem.
Any alternatives to Amelio I should know about? Does Amelio have enough hooks to allow one to write their own config screen? Or would I just be using HID utilities at that point?
Game input in Cocoa - OneSadCookie - Oct 24, 2003 03:15 PM
Amelio does come with the source, so if you don't like something, you can always go in and fix it... I'd say it's got to be easier than working straight with the HID utilities...
Game input in Cocoa - GoodDoug - Oct 27, 2003 05:32 PM
I just had to rip Amelio out of my uDG project. It worked on my machine, but not on others... I have wrapped the HID Utilities stuff from the Apple Developer Examples to do what I want. It's not the easiest thing to grok, but once you do, it's pretty straightforward.
my old uDG entry ZedNought used the wrappers I wrote. I'll be updating them for this years entry.
Sorry i don't have much more information other than "Caveat emptor" with Amelio
Game input in Cocoa - OneSadCookie - Oct 27, 2003 05:49 PM
I wrote my own HID stuff (straight, without even the HID utilities) over the weekend. The state of the documentation and sample code was a bit frustrating, but I'm quite happy with what I ended up with.
Hopefully I'll be able to wrap this up as sample code or a library at some point, but I think I should get more than just the keyboard working before I do
Game input in Cocoa - geowar - Nov 4, 2003 12:27 PM
HID Utilities: <http://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/HID_
I'm currently the DRI for the HID Utilities. I almost have a new version ready for posting. It sounds like I also need to include some documentation to explain how to use it. For the existing code read thru the <HID_Utilities_External.h> file.
The "interesting" API's are:
HIDBuildDeviceList - This creates a list of HID devices.
HIDReleaseDeviceList - call this when you're done with the list.
HIDGetFirst/NextDevice - used to iterate the devices
HIDGetFirst/NextDeviceElement - used to iterate elements of a device.
HIDGetElementNameFromVendorProduct[Cookie|Usage] - Get text name of an
HIDQueueDevice - Add all device elements to event queue
HIDDequeueDevice - remove all device elements from event queue
HIDQueueElement - Add element to event queue
HIDDequeueElement - remove element from event queue
HIDGetEvent - poll queue for events
You may incorporate the entire HID Utilities into your project as-is or cut & paste the pieces that you need.
If you have any specific questions or suggestions about the HID Utilities you may email me at <email@example.com>.
George Warner, (408)974-0668
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)
As an extra service to our developers, we in Apple's Developer Technical
Support (DTS), are encouraging all of our developers to check out our cool
*NEW* web-sites for access to lots of new sample code and to see if any of
your questions have already been answered.
Sample code: <http://developer.apple.com/samplecode/index.html>
Technical Docs: <http://developer.apple.com/techpubs/index.html>
Mailing Lists: <http://www.lists.apple.com/>
Tech Info Lib: <http://kbase.info.apple.com>
Game input in Cocoa - aegidian - Nov 4, 2003 03:47 PM
Wade Williams posted the following response to the recent cries for help:-
In a general sense, there's nothing wrong with the HID Utilities code. (I say in a general sense because I know those with complex needs have things they'd like it to do different/better)
What is wrong from your point of view is that there's no real documentation, so to read the headers and sample code and figure it out assumes you have some experience.
So, with that said, let's try to make it as easy as possible.
1) Download the HID Utilities sample code.
2) Double-click the HID Utilities slib.pbproj file to open it in Project Builder.
3) Click build. This will create a build folder that will contain libHIDUtilities.a once it's finished building. (Actually building it may not be necessary, but it doesn't hurt.)
4) Add libHIDUtilities.a to your project.
5) Add #include "HID_Utilities_External.h" and #include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
to your joystick code file.
6) Build a list of devices by doing:
[edited for line wrap - w_reade]