iDevGames Forums
HID Input Library - give me your wishlist - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Tools & Technology (/forum-10.html)
+--- Thread: HID Input Library - give me your wishlist (/thread-3977.html)

Pages: 1 2


HID Input Library - give me your wishlist - Fenris - Aug 19, 2006 01:59 AM

Hi all,

Every now and then, people whine about Apple's HID (essentially gamepad/joystick) SDK support. The HID Manager isn't exactly straightforward, and while the HID Utilities are nice, they're just halfway towards being really good.

What I'm planning to do is to write a proper framework for handling gamepads and joysticks (with bindings in C++ and Obj-C) during the coming autumn, and I would love to hear some input on what you want it to do. So, all those things you never dared ask for goes here. Wink


HID Input Library - give me your wishlist - Zwilnik - Aug 19, 2006 02:45 AM

#include "GamepadLib.h"

InitGamepad();

ConfigureGamepad(n);

ButtonArray = GetGamepad(n);

that's all I want to see Smile


HID Input Library - give me your wishlist - DanLab - Aug 19, 2006 03:05 AM

Zwilnik Wrote:#include "GamepadLib.h"

InitGamepad();

ConfigureGamepad(n);

ButtonArray = GetGamepad(n);

that's all I want to see Smile


i prefer

InitFrenchGamepad();

ConfigureCheeseGamepad(n);

ButtonArray = GetFroggyGamepad(n);

et voila LOL


its a good idea, remember to add the forcefeedback too


HID Input Library - give me your wishlist - Joseph Duchesne - Aug 19, 2006 06:49 AM

InitCanadianGamepad();

ConfigureCheeseGamepad(n);

ButtonArray = GetFroggyGamepad(n);

forceSomeFeedBack(n);

And poof! Force feedback.

Or you just use a big heavy bass and hope they have a nice sub-woofer.


HID Input Library - give me your wishlist - unknown - Aug 19, 2006 06:53 AM

Support for multiple mice please!


HID Input Library - give me your wishlist - Fenris - Aug 19, 2006 07:13 AM

So basically, would a data structure that doesn't do much more than metadata (controller name/vendor and type), button state bit array, and normalized vectors for analog sticks be the preferred format?

Considering that HID presents most input elements in a tree structure, which is truly annoying, I'd like to flatten that into just such arrays as Zwilnik proposes. Is there a reason for anyone to keep the hierarchy alive in the framework?


HID Input Library - give me your wishlist - DanLab - Aug 19, 2006 07:21 AM

just make it simple !

return all in c string or int or float
dont want to play with aother stupid tihng that eat time

for exemple you can create some fonction that return the gamepad name
gamepad_givename(gamepadID, &namethingy);
gamepad_howmanygamepadpluged();
gampad_button_1(gamepadID)
gampad_button_2(gamepadID)
gampad_button_3(gamepadID)

i think nobody care about the hierarchy


HID Input Library - give me your wishlist - Zwilnik - Aug 19, 2006 08:19 AM

If I see the word Handle I'll hit someone Wink

Simple is definitely the way. If anyone wants some sort of extra uber complicated functionality they can bolt it on afterwards.

If the aim is to make a straightforward HID framework then the simplest common format is best. Ideally, make it so that 'Gamepad' is a common set of functions for reading an actual gamepad *as well* as keyboard.

As Dan suggested, duplicating the functionality of the array with straightforward button checking functions (button held or button pressed being particularly useful) would do no harm either.


HID Input Library - give me your wishlist - codemattic - Aug 19, 2006 10:15 AM

I was quite fond of Amelio, but it never caught on. It could be used from carbon or cocoa. Worth taking a look at.

It had a seperate app that you could use to make graphical GUIs for your specific devices - so that the interface would have an image of your joypad and show you where the controls were. And when it started up it checked on the web for GUIs that anybody else had already created for your device. If it couldnt find a driver and you didnt want to create one it used a regular pull-down menu for whatever controls it could find.

It also let you calibrate your analog controls.

It used to be hosted here on idevgames.com, but has gone away.


HID Input Library - give me your wishlist - Nick - Aug 19, 2006 10:59 AM

I would rather see this as an OO thing rather than take the form of SDL like you suggested. Something more like this:

Code:
//choose your favorite method of creating the object
     HIDGamePad *pad = HIDManager::getSingleton().createGamepad();

     pad->isButtonDown(n);

     float x = pad->getXAxis();

I just believe that format is more appealing.


HID Input Library - give me your wishlist - unknown - Aug 19, 2006 11:05 AM

if a higher level OO structure would suit you better then it would probably make most sense to implement that yourself on top of an easy to use lower level structure.


HID Input Library - give me your wishlist - Skorche - Aug 19, 2006 12:12 PM

I kind of agree with unknown. An easy to use low level structure would be preferable. That way you could do whatever with it.

I'm fairly fond of SDL because it works with pretty much any input device. Being able to use input in a unified way from the keyboard, mouse and gamepads/joysticks is nice. It's event loop is also nice.

My wish-list:
* Joystick axes return floats. [-1, 1]
* State polling. (i.e. get_joystick_axis_value(joynum, axisnum) -> float)
* Support for event loops. get_events() -> a list of events since the last call
* C interface.
* keyboard values map to ASCII when possible. (really handy in SDL)
* Multithreaded support. Rasp


HID Input Library - give me your wishlist - aarku - Aug 19, 2006 12:55 PM

What to do with out of spec devices? (Like mice that report 256 buttons...)

This has to be a easy to use low level C interface. It's the common denominator.

-Jon


HID Input Library - give me your wishlist - Zwilnik - Aug 19, 2006 01:08 PM

aarku Wrote:What to do with out of spec devices? (Like mice that report 256 buttons...)

This has to be a easy to use low level C interface. It's the common denominator.

-Jon

Totally. no point in doing a C++ only interface, might as well waste time with the Apple HID library for that.

As far as device spec. decide on a reasonable maximum number of buttons and controls and limit to that. If a controller is reporting more than 4 analog axis, a dpad and 16 buttons, just ignore the extras. That way it makes the interface (for both coder and player) more straightforward. If company x wants you to support their funky 256 button mouse they can write a driver for it Smile

Games get designed to the minimum spec for controllers anyway, so there's no point in overcomplicating the API just to support wierd stuff.


HID Input Library - give me your wishlist - Fenris - Aug 19, 2006 08:09 PM

Awesome input (heh!) everyone, keep it coming. I might get this off the ground sooner than planned just because I'm so intrigued! Smile