HID Input Library - give me your wishlist
one other request. if the API also solves the issue of getting mouse and keyboard input while in a window or fullscreen in Cocoa it would be great. A one stop game input API
My additions to the wishlist:
- Hatswitch support similar to joystick axes, i.e. in addition to "joystick x [-1 to 1]" have "joystick hatswitch x [-1 to 1]"
- Some easy way to identify any input element at runtime so I can save them and allow them to be customized
- Support for multiple joysticks/gamepads is nice (but not exactly necessary)
- Hatswitch support similar to joystick axes, i.e. in addition to "joystick x [-1 to 1]" have "joystick hatswitch x [-1 to 1]"
- Some easy way to identify any input element at runtime so I can save them and allow them to be customized
- Support for multiple joysticks/gamepads is nice (but not exactly necessary)
• Ease of use (see first reply)
• Work in C
• Allow users/driver writers to assign names to buttons/axes. I have no idea what Button #14 is on my 15 button Xbox 360 controller, when told to press it on Halo (for instance)
Looking forward to seeing it! Thanks for taking on the job.
• Work in C
• Allow users/driver writers to assign names to buttons/axes. I have no idea what Button #14 is on my 15 button Xbox 360 controller, when told to press it on Halo (for instance)
Looking forward to seeing it! Thanks for taking on the job.
My additions for it to be game programmers' best friend:
- Compatible with SDL event handling (or if not possible, make it cover keyboard & mouse input transparently)
- Option for it to automatically prepare a mean espresso every ~4 hours of coding...
PowerMacX Wrote:My additions for it to be game programmers' best friend:
- Compatible with SDL event handling (or if not possible, make it cover keyboard & mouse input transparently)
I disagree with that. If you want SDL events, why not just use SDL? Besides, doing that would add pretty severe limitations, and be pretty hard for poor Fenris to achieve.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
SDL has its own joystick handling; is it not adequate for your purposes?
OneSadCookie Wrote:SDL has its own joystick handling; is it not adequate for your purposes?
Not for mine. Each time SDL launches it scans the USB chain looking for devices (that adds about two seconds onto the launch time of the application - two seconds is an especially long time when you run the app lots of times to work on it).
I want a solution like El Ballo had (it's worth picking up a copy for yourself) where it caches the data and unless the user selects another gamepad, tries to use that gamepad (correct me if I'm wrong Ivan - I sometimes have a bad memory when it comes to specific details of stuff I've explored, I really should write some of this down). I also had troubles getting joystick axises to return accurate values (I even went out and bought another one, thinking the hardware was defective)
If of course if this could be spawned off into another thread, that would probably be ideal for the two second delay (although I don't like how it just gobbles CPU cycles in the process, IIRC).
Skorche Wrote:I disagree with that. If you want SDL events, why not just use SDL? Besides, doing that would add pretty severe limitations, and be pretty hard for poor Fenris to achieve.
So, if I'm reading this correctly, there is still hope for my second suggestion?
OneSadCookie Wrote:SDL has its own joystick handling; is it not adequate for your purposes?
Last time I tried it, it just plain didn't work (didn't detect anything nor gave any errors), but that was a while ago. I'll do some testing with the last version once I can borrow some controllers to try against.
I've used joysticks with neverball and spacetripper, and they seemed to work well there. Both have their own calibration code, of course. The startup performance penalty doesn't sound like fun, though.
Derek: I have noticed that SDL seems to use an inordinate amount of CPU to process events. (In some cases, more than the Ruby code it calls to use them) I've never noticed a startup delay though. Does it depend on the gamepad you are using?
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Skorche Wrote:Derek: I have noticed that SDL seems to use an inordinate amount of CPU to process events. (In some cases, more than the Ruby code it calls to use them) I've never noticed a startup delay though. Does it depend on the gamepad you are using?
Although I don't want to get too off topic, here's what I'm talking about:
Code:
if(Settings.USE_JOYSTICK) // or gamepad
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
else
SDL_Init(SDL_INIT_VIDEO);It's simply calling 'SDL_INIT_JOYSTICK' that causes SDL to search the chain and create a delay.
would adding SDL event compatibility force linking to the SDL library? If so forget it, not all of us use SDL or want to use it.
If the HID usability library gives you gamepad/mouse/key input anyway I can't see much point of SDL event compatibility to do the same input.
If the HID usability library gives you gamepad/mouse/key input anyway I can't see much point of SDL event compatibility to do the same input.
Zwilnik Wrote:If the HID usability library gives you gamepad/mouse/key input anyway I can't see much point of SDL event compatibility to do the same input.
That's the thing, either joystick support in a way that still allows SDL to manage other events (window/keyboard/mouse) or support for mouse & keyboard so SDL event support is not necessary.
Anyway, as long as it has a C interface, it shouldn't be a problem to integrate at a later point (a fork?) if it turns out to work better than SDL's joystick support.
Here is some code that may prove to be a useful starting point.
http://www.idevgames.com/forum/showthread.php?t=13336
http://www.idevgames.com/forum/showthread.php?t=13336
Sir, e^iπ + 1 = 0, hence God exists; reply!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Console-style gamepad/input library | Carlos Camacho | 9 | 5,272 |
Jan 8, 2007 04:20 PM Last Post: OneSadCookie |
|

