Re: [Plib-devel] Saitek X52 joystick with 34 buttons
Brought to you by:
sjbaker
From: Trammell H. <hud...@sw...> - 2005-05-04 23:35:56
|
On Wed, May 04, 2005 at 04:12:55PM -0700, Steve Baker wrote: > Trammell Hudson wrote: > >I've recently started using a Saitek X52 joystick with my Linux box and > >have run into problems with plib's JS module limitation in the number > >of supported buttons. It only supports up to 32 buttons due to the > >MAX_BUTTONS definition and the fact that it uses an int to store the > >button state, but the X52 has 34 buttons (and 12 axes). > > That's practically a keyboard! I'm not sure I could touch type on it -- I have enough trouble remembering which button is "lower the flaps" and which one will irrevocably initiate the autodestruct sequence. > [...] > I personally find it very hard to believe that there are any > applications out there that would actually use that many - so > for now, I'm not inclined to change the interface to support > more buttons. Flight simulators have an insatiable desire for more buttons and axes. In this case, I have a subset of these mapped, depending on the flight model that I am debugging: Flaps up/down Gear up/down Speed brakes up/down Arrestor hook up/down Forward view POV "Check 6" Autopilot mode Autopilot heading bug left/right Drouge chute Ejector seat Left brake Right brake Timer start/stop/reset Elevator trim up/down/reset Rudder trim left/right/reset Vector sweep forward/aft Thrust vector up/down Weapon select Pause Engine start Flight model load/save/reset > If there is a bug to fix in *limiting* the number of buttons > to 32 - then we should fix that. plib doesn't seem to have a problem, but other applications do. xplane, for instance, maps 32 -> 0 and 33 -> 1 on Linux. On OS X, it doesn't see any button higher than 16 (I think -- not all of them work and I haven't done any serious debugging on it). > >Changing tmp_buttons to a uint64_t, updating the arguments to > >jsJoystick::rawRead and jsJoystick::read fixed that for me. > > But it would break other applications. We absolutely cannot do that. Exactly, which I why I cautioned against on making the change too soon, since there is probably a better way to represent button state rather than a single integral type bitmask. It worked for me on my system, but I was recompiling plib, SimGear and FlightGear from source, so there was no problem with binary compatibility. Trammell |