Re: [Plib-devel] Saitek X52 joystick with 34 buttons
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2005-05-04 16:25:05
|
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). This code in > jsLinux.cxx is the problem: Hi Trammell! I'll be happy to commit your changes to CVS. However, before I do that, I need to check for portability. jsLinux.cxx is pretty safe to adapt. However, js.h is cross-platform, and I wonder about the portability of uint64_t. Do all plib platforms know uint64_t ? It seems to be defined by stdint.h, which is included in inttypes.h This is something I found with google on the subject of inttypes (which seems incompatible with Nec SX-5 super computers ;-) In the email thread, a lack of standardization is mentioned. http://www.cactuscode.org/pipermail/developers/2004-September/000608.html So... what to do? Bram Stolk > > case JS_EVENT_BUTTON : > if ( os->js.value == 0 ) /* clear the flag */ > os->tmp_buttons &= ~(1 << os->js.number) ; > else > os->tmp_buttons |= (1 << os->js.number) ; > break ; > > Changing tmp_buttons to a uint64_t, updating the arguments to > jsJoystick::rawRead and jsJoystick::read fixed that for me. > > Another problem is that the mode switch holds down one of three > buttons depending on which of the three modes is selected. This > interferes with the calibration routine used by FlightGear and > required me to modify the fgjs program. Any code that uses > level triggered button handling may run into starvation as it > always services the mode buttons. > > With FC3 I had to patch my kernel's USB hid-core file, as documented > here to deal with the slow joystick device. Apparently Saitek has some > problems across their entire product line -- the patch was originally > for an X45 joystick, but works for the X52 as well: > > http://baron.flightgear.org/pipermail/flightgear-users/2004-July/008234.html > > Trammell > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 > _______________________________________________ > plib-devel mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-devel |