Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: Muriac on January 31, 2006, 01:30:11 pm

Title: Hatswitch not recognized (OS X)
Post by: Muriac on January 31, 2006, 01:30:11 pm
Everything else works perfectly, but FS_Open refuses to recognize my joystick's hatswitch. I'm using a Saitek Cyborg evo, and every button and all four axes work in FS_Open. The hatswitch, while recognized by a USB controller testing application I downloaded, is not recognized by FS_Open. It's an eight-way switch.

I can't really think of what other information might help, but I'd be happy to post whatever is needed.
Title: Re: Hatswitch not recognized (OS X)
Post by: Mr_Maniac on January 31, 2006, 03:27:43 pm
Is your Hatswitch recognized by Linux as two axis?
That's how it is for me...
I have an Saitek Cyborg Stick 3D Rumble Force...

I start FS2_Open with:
Code: [Select]
SDL_LINUX_JOYSTICK="'Saitek Cyborg 3D Rumble Force' 4 1 0" ./fs2_open_r
Of course, you would have to customize this line (I found the right synthax somewhere in the internet ;) )

EDIT: Whoops... OS X...
Okay... But SDL is SDL and maybe it's the same problem ;)
Just take a look...
Title: Re: Hatswitch not recognized (OS X)
Post by: Muriac on January 31, 2006, 04:23:00 pm
Sorry, I don't know to talk to SDL in OS X.
Title: Re: Hatswitch not recognized (OS X)
Post by: knallfrosch on April 13, 2006, 06:06:43 pm
I'm using a Saitek evo force on OS X (10.4.6 Tiger) and all buttons work. things that dont work so far: throttle, force feedback.
Title: Re: Hatswitch not recognized (OS X)
Post by: CaptJosh on April 27, 2006, 10:44:57 am
Well, I currently have an MS Sidewinder Force Feedback Pro, and under Linux, the hatswitch is showing up as another set of axes instead of buttons. It's damned annoying, as I like to use my hat switch for things like targeting bombs, changing the fire rate of my missiles, targeting unscanned cargo, and one other thing that I've forgotten at the moment, and I can't assign any of those functions to an axis.
Title: Re: Hatswitch not recognized (OS X)
Post by: taylor on April 27, 2006, 12:08:03 pm
Well, I currently have an MS Sidewinder Force Feedback Pro, and under Linux, the hatswitch is showing up as another set of axes instead of buttons. It's damned annoying, as I like to use my hat switch for things like targeting bombs, changing the fire rate of my missiles, targeting unscanned cargo, and one other thing that I've forgotten at the moment, and I can't assign any of those functions to an axis.
That's an SDL issue, you have to tell it there is a HAT on the joystick and then it should use it properly.  All you need is to set a proper environment variable and it should work fine after that.  Look here for the variable and how to use it (the var is "SDL_LINUX_JOYSTICK"): http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fenvvars
Title: Re: Hatswitch not recognized (OS X)
Post by: CaptJosh on April 27, 2006, 01:20:16 pm
That's interesting, but where does the variable go? It doesn't say on the page.
Title: Re: Hatswitch not recognized (OS X)
Post by: taylor on April 27, 2006, 01:57:33 pm
If you run the game from the command line then you can just do "export SDL_LINUX_JOYSTICK='Joystick Name' numaxes numhats numballs" and then run the game.  To make it permanent just add the same line to ~/.bash_profile and it will automatically set everytime you log in.  After you make that change just log out of X then log back in, the variable will now be active always and you should be ready to go.
Title: Re: Hatswitch not recognized (OS X)
Post by: CaptJosh on April 27, 2006, 03:43:23 pm
Great. I just hope the name for the stick in Yast is the name that this will need. Thanks.
Title: Re: Hatswitch not recognized (OS X)
Post by: taylor on April 27, 2006, 04:13:59 pm
If you run a debug build just check your ~/.fs2_open/data/fs2_open.log file.  Where it initializes the joystick it will also print out the name that SDL sees it as.  It also prints out the number of axes, buttons, and hats so you can be sure that it is actually seeing things like it's supposed to.
Title: Re: Hatswitch not recognized (OS X)
Post by: CaptJosh on April 28, 2006, 04:28:51 am
I don't think I've ever had the CVS stuff build a debug build. Hrm... Guess I'll have to try the prebuilt one.

EDIT: Or not. There aren't any, yet.