Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to deal with varied input devices?



At 1:30 PM -0600 9/04/02, James Powell wrote:

It would be great if someone solved this problem and donated the code to SDL (www.libsdl.org). SDL already has some level of support for keyboard, mouse, and joysticks, but I don't see any support for d-pads on OS X.

This might work for you: HID Wizard from Z Sculpt.

I looked at that, but right now I don't believe it's the right solution for my needs. There are primarily three reasons I say that:

1. It asks the end-user for a donation (as you pointed out); I think what we need is a widely-adopted solution that's free.

2. It didn't work with my controller, and there seems to be no way I can make it work through any configuration process.

3. It uses the ISp configuration interface, which frankly, I found confusing when it was first introduced and I still find confusing, years later.

Of course #3 implies that I may be wrong about #2, but I don't think so.

I've been giving a lot of thought to this over the last few weeks, and I think what we need should look something like this:

- A free, open-source app is made available for testing and configuring your input devices. In particular, this lets you give a meaningful name (e.g. "Left Trigger" instead of "Button #13") to each element, and lets you define "virtual elements" which combine or split the raw elements into something more useful. For example, you could define a virtual d-pad that client apps would see the same way, regardless of whether the raw HID elements report your d-pad as four buttons or two analog axes or whatever.

- This configuration info would be written to a preferences file in an open, documented format. The documentation would include sample code for reading and making use of this info.

- The configuration app should also have the ability to download device configurations from some server on the net, so that hopefully most users will discover that their device is already known and no extra configuration is needed.

- Client apps (games) would then load the configuration info from the prefs file and make use of the named, raw or virtual elements. I picture typical usage within a game to be something like in Quake III: you click on a function (e.g., move player), and then press the controller element you want to use that function. The game is watching for a certain type of elements (e.g., joystick), sees which one you wiggled, and then displays its name next to the function. This is much like the HID Utilities "configure" method, except that it works with virtual elements (defined in the configuration app) rather than just the raw ones.

- Quite possibly, there should be a code library to encapsulate the details of loading and using these user-defined elements.


This scheme should allow you to get just about any controller to present the elements you need (e.g., you can make a joystick act like a d-pad, a d-pad or four buttons act like a joystick, etc.). It's good for the user because they have a single, dedicated app to configure and test their input devices; separating this functionality out from any particular game makes it much less confusing. And it's good for game developers, because they can avoid the mess of a gazillion different input schemes, and simply ask for the sort of input they need.

I have more details in my head, but that's the gist of it. Comments?

Thanks,
- Joe

--

,------------------------------------------------------------------.
| Joseph J. Strout Codenautics: quality Mac software |
| email@hidden http://codenautics.com/ |
`------------------------------------------------------------------'
_______________________________________________
mac-games-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-games-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: how to deal with varied input devices? (From: "James Powell" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.