Thread: [Plib-devel] joystick jungle
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2005-03-09 17:47:32
|
sgHello() I'm struggling with the lack of joystick/gamepad/wheel standardization. There does not seem to be a manner by which I can get to know more about an axis for a linux joystick. Maybe this kind of stuff is in directx, but I want this kind of info on joystick axes: - Is axis part of a 2DOF joystick? - Is axis an accelerator pedal? - Is axis a brake padel? - Is axis combined brake/accel? - If axis is up/down joystick, is up positive or negative? - Is the axis analog? (Strangely enough, digital pads are treated as axes, not buttons) I assume no API exists for getting this info. And if this is the case, I think a 'joystick database' indexed by the USB device name would be a valuable asset for many projects. Does anyone on this list know whether such a db exists? And if not, I think I want to start one. I dont care if at first it will only contain a handful of the 1000s of current gamepads. The alternative is probably to burden the user by configuring his joystick which seems ugly to me. Bram |
From: Steve B. <sjb...@ai...> - 2005-03-09 23:26:05
|
Bram Stolk wrote: > > sgHello() > > > I'm struggling with the lack of joystick/gamepad/wheel standardization. > There does not seem to be a manner by which I can get to > know more about an axis for a linux joystick. > > Maybe this kind of stuff is in directx, but I want this > kind of info on joystick axes: > > - Is axis part of a 2DOF joystick? > - Is axis an accelerator pedal? > - Is axis a brake padel? > - Is axis combined brake/accel? > - If axis is up/down joystick, is up positive or negative? > - Is the axis analog? > (Strangely enough, digital pads are treated as axes, not buttons) > > I assume no API exists for getting this info. Not AFAIK. > And if this is the case, I think a 'joystick database' indexed > by the USB device name would be a valuable asset for many projects. Yes - it would - but only if it was actively maintained. This would actually be a fine job for a Wiki. > Does anyone on this list know whether such a db exists? Not that I know of. > And if not, I think I want to start one. I dont care if at first > it will only contain a handful of the 1000s of current gamepads. Yep - if it could be EASILY updated by anyone, it would grow at exactly the rate that people with new joysticks tried to use them. You could include something like the PLIB 'joytest' program to help people figure out which functions were on which buttons/axes. The hard part (I guess) is coming up with a sufficiently rigerous - yet flexible nomenclature for all of the buttons and axes. For some people, a controller with two foot pedals and a lever has 'Brake, Throttle and Shifter', but for other people, it has two rudder pedals and a throttle lever. That could be pretty confusing! > The alternative is probably to burden the user by configuring > his joystick which seems ugly to me. Yes, it is. ---------------------------- Steve Baker ------------------------- HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://www.sjbaker.org Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++ -----END GEEK CODE BLOCK----- |
From: Andy R. <an...@pl...> - 2005-03-09 23:32:37
|
Bram Stolk wrote: > Does anyone on this list know whether such a db exists? And if not, > I think I want to start one. I dont care if at first it will only > contain a handful of the 1000s of current gamepads. FlightGear has definitions for most of the popular hardware available. Most of those have axis/button enumerations in the comments at the top of the XML file. Probably a good place to start. Andy |
From: Bert D. <dri...@pl...> - 2005-03-10 01:05:56
|
On Wed, 9 Mar 2005, Bram Stolk wrote: > I'm struggling with the lack of joystick/gamepad/wheel standardization. > There does not seem to be a manner by which I can get to > know more about an axis for a linux joystick. > > Maybe this kind of stuff is in directx, but I want this > kind of info on joystick axes: I doubt DirectX fares better. I have four different USB joysticks geared more or less to flight simulation, plus a pedal set, and unless the app comes with a database of joysticks there is little logic to default assignments. > - Is axis part of a 2DOF joystick? > - Is axis an accelerator pedal? > - Is axis a brake padel? > - Is axis combined brake/accel? > - If axis is up/down joystick, is up positive or negative? > - Is the axis analog? > (Strangely enough, digital pads are treated as axes, not buttons) I'm not sure how many plib apps support those hat switches; I think there is something to be said to introduce a seperate "hat" abstraction, along with axis and button. > I assume no API exists for getting this info. > And if this is the case, I think a 'joystick database' indexed > by the USB device name would be a valuable asset for many projects. > > Does anyone on this list know whether such a db exists? > And if not, I think I want to start one. I dont care if at first > it will only contain a handful of the 1000s of current gamepads. > > The alternative is probably to burden the user by configuring > his joystick which seems ugly to me. Many Windows games come with extensive databases for joystick to application matching, and I rarely use the defaults for long. I have copies of Microsoft Flight Simulator (of different vintages), I have X-Plane, I use FlightGear. Then, to make matters worse, I have MS TrainSim, Trainz and BVE, but no trainsim specific devices, so I control brake line pressure with the Cessna-styled "Mixture" control of a CH Yoke. The three flightsims and four joysticks make for twelve combinations. There is no guessing which button will extend the flaps, or reduce them, not with an identical joystick across games, and not with an identical game across joysticks. The default aileron/elevator control on a Logitech Rumblepad is usually the left joystick, which really is a bad choice for righthanded folks. Etcetera, etcetera: my list of gripes is endless. Oh, and that's without changing airplane types in the sim, e.g. going from a plane with one brake to a type that support differential braking. The practical upshot is this: the first thing I do when I get a new sim (or must re-install one) is to remove all assignments, then reassign them (the ones I need, that is). I think the hard part is not in having to assign them, but in user interface design. I can recommend anyone interested in this to look at X-Plane 8.x (http://www.x-plane.com/, available for Windows, MacOS 9 or X, and some recent Linux versions). Download the demo and try to assign joystick axes and buttons. The screen looks daunting and unfriendly, but it isn't until you justapose MSFS's screen that you'll appreciate how well X-Plane's is done. The ideal Joystick configuration GUI - knows different layouts for analogue inputs: X-Y, Y-only, X-only, slider, 270 degree knob (this needs a database) - can present all axes as simple representations of the above choices - can store profiles per app, per joystick - can default a profile to an existing one - can map all available axes to terms relevant to the app, so the user can answer the question "what does this button do?" X-Plane's weakness is in dealing with hats (represented as eight unrelated buttons). I have not yet checked how well it can deal with different joysticks (in other words, if it stores profiles per Joystick or not). And actually, FlightGears's fgjs ain't bad, except that it can be a challenge to get all button assignments right in one go, as eventually the "ANY" button will come up for assignment :-) Other good ideas can be had from Logitech's Windoze drivers (which are not my favorite drivers, but they come with good representations to visualize button and axis assignments). So if anyone has any time to burn, I would recommend improving the GUI to do assignment (possibly as an advanced plib widget, accepting a list of possible actions and preexisting assignments, and returning user assignments and/or maintaining profiles). The key functionality missing from most GUI's is the basic "what does this button do" thing. But even just a simple GUI version of fgjs that allows for going back and fixing mistakes would be an improvement. It should not be rocket science to write such a joystick profile manager to be application independent (but I'm the first to admit it will be a lot of work to get the GUI just right). Anyway, before embarking on the idea of a joystick database I'd suggest having a critical look at existing attempts to do precisely that on Windows (e.g., Logitech's profile manager, which covers dozens of joysticks and hundreds of games and can make a 2GHz machine feel like a 486/33). Cheers, -- Bert -- Bert Driehuis -- dri...@pl... -- +31-20-3116119 If the only tool you've got is an axe, every problem looks like fun! |
From: Bram S. <br...@sa...> - 2005-03-11 19:44:02
|
People, Thanks for the feedback on the joystick issues. To clarify one thing: I'm not addressing the issue of how to map functionality onto switches. At first, I only want to address the issue on retreiving joystick specifics. Function mapping is app-specific. The flightgear xml merely covers the mapping bit, (which is based on implicit knowledge on the device specifics, and is flightsim oriented). Steve's suggestion about wiki sounds reasonable, and I agree very much on the problem on nomenclature. I've come up with this scenario: Users are asked to run a tool. The tool queries the joystick name, and sends it to a server. The server checks if the name is known, if it is, and at least two identical reports are submitted for it, thank the user for participating. If the joystick is unknown, or has a single unconfirmed report, Ask the user: - turn wheel if present. - move joysticks up-right, going from leftmost js to rightmost js. - press pedals, going from leftmost pedal to rightmost pedal. - pull shoulder-buttons going from left to right, - etc... The util will be able to check axis-polarity and axis-resolution (if only -32768 0 and 32767 are seen, its digital). Each month or so, the db content could be made available in a plib header or something. Bram |