Modding, Mission Design, and Coding > Cross-Platform Development

Linux joystick problems

(1/3) > >>

Mr_Maniac:
Hey... I just remembered:
Fs2_open_linux can't use some "features" of my joystick:
Throttle-Axis (z-axis), rx-axis and the coolie-hats...

But I didn't ever gave some more info about my joystick! Maybe this would help you!

My joystick is a
Saitek Cyborg 3D Rumble Force (USB/HID-Device).
It's fully functional under linux (okay... Force Feedback still is not supported ;) ).
It has the following features:
6 axis (x, y, z, rx)
9 Buttons
1 Coolie-Hat

When I use jstest, I see that the axis are mapped "strange":
0 = x
1 = y
2 = Coolie-Hat left/right
3 = Coolie-Hat up/down
4 = z
5 = rx

Shouldn't z and rx come first?


And... Uh... jstest also reports 23 axis!! Why that?


And now a question to all FS2_open_linux-users:
How many of you do have / use a joystick and does this joystick have an z- and rx-axis?

Mr_Maniac:
And another question:
I took a look into the code...
Well... I don't code C(++) but one thing looks suspicious to me...


--- Code: ---                if (joy)
                {
                        nprintf (("JOYSTICK", "Joystick #%d: %s\n", j - JOYSTICKID1 + 1, SDL_JoystickName(j)));
                        if (j == Cur_joystick) {
                                for (int i = 0; i < SDL_JoystickNumAxes(joy); i++)
                                {
                                        joystick.axis_valid[i] = 1;
                                }
                        }
                        SDL_JoystickClose (joy);
                }
--- End code ---


If a joystick gets detected and used, a message is drawn (written in log file), right?
But there's no such message in my fs2_open.log or somewhere else?

Mr_Maniac:
Okay... I've found something out!
FS2_Open can use ALL Axes of my Joystick!
The Problem is: It doesn't do it!
I mean... When I set my coolie-hats for steering (instead of my X-/Y-Axis) I can steer with them...
Same with my Throttle- / Rudder-Axis...
So FS2_Open just don't use the settings from the options-menu???
That's very strange!

taylor:

--- Quote ---Originally posted by Mr_Maniac
If a joystick gets detected and used, a message is drawn (written in log file), right?
But there's no such message in my fs2_open.log or somewhere else?
--- End quote ---

The nprintf() is the key there.  Those are filtered so that only what you want goes in the log.  I think that only "General" and "Warning" go in by default so "JOYSTICK" won't show up unless you tell it to.  The easiest way is to "touch ~/.fs2_open/data/debug_filter.cfg", assuming that file doesn't exist yet.  Next time you run the game that file will start being populated with the various message types.  You can edit it later to turn off things that get logged.  So for something like table parsing, which I find pretty much useless, you would change this line "+Parse" to "-Parse" and it would silence the parse messages.  The various options are case insensitive as well so don't worry about what case it is.

And I do use a joystick, a Logitech Wingman Force, though it's not connected right now.  It's got a throttle control which does work as well as a HAT which also works.  The HAT is an issue since you have to tell SDL that it exists.  If you don't then you'll have weird axis problems.  This is done with an environment variable but I can't remember off the top of my head what that is.  A search on libsdl.org should find it if you aren't already using it.

Mr_Maniac:
Okay okay....
The real Problem IS, that my coolie-hats get handled first!
Axis-Mapping:
x>x
y>y
Coolie-hat left/right>z
Coolie-hat up/down>rx
Rudder>ry
Throttle>rz

I've found the environment variable you are talking about, but there's this problem again!
My Coolie-Hat gets mapped to throttle and rudder and my throttle and rudder will be used as the coolie hat!
I'm searching in the whole Internet but I can't find a solution!
And why doesn't fs2_open accept ry and rz as Throttle and Rudder?
It seems to accept only z and rx!
I'm confused!
Can I try some code-hacks? I've already tried to swap the numbers in code/controlsconfig/controlsconfig.h...
And I've tried many changes in the code!
And I'll try further things...
Maybe I'll be successful somewhen :)

EDIT:
fs2_open DOES only use x,y,z and rx...
I can map ry and rz to anything I want in the options-screen but it doesn't work...

Navigation

[0] Message Index

[#] Next page

Go to full version