Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre? (solved)

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

Post Reply
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Sun Jun 20, 2010 6:00 pm

Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre? (solved)

Post by mcarans »

According to https://wiki.alioth.net/index.php/Joyst ... ms_(Linux), "Prior to Oolite v1.80, deadzone and responsiveness issues in Oolite Linux could only be solved by making use of the jscal, jstest and jstest-gtk utilities, but Oolite now has built-in joystick configuration and tuning software, which can solve these problems. A tutorial on how to set up and tune your joystick can be found here. "

Does this mean Oolite > 1.80 ignores calibration in jstest-gtk?

If so, then how do I calibrate a drifting joystick's centre point to be correct?
Last edited by mcarans on Mon Jun 30, 2025 8:38 am, edited 1 time in total.
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Sun Jun 20, 2010 6:00 pm

Re: Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre?

Post by mcarans »

I found the answer in the wiki! https://wiki.alioth.net/index.php/Joyst ... ms_(Linux) says:

"Button Detection & Axis Range Problems

For unknown reasons, it appears that sometimes SDL (Simple DirectMedia Layer) takes raw input from the evdev device drivers, instead of using the correct joystick device. By adding the appropriate environment variable to either the /etc/environment file, or the .bashrc startup script, you can force SDL to use the "real" joystick driver for input.

Officially speaking, /etc/environment is the correct place for system-wide environment variables. To add the environment variable to the /etc/environment file, as root, open /etc/environment in your text editor, add the following (on a new line) to the file, and save:

SDL_JOYSTICK_DEVICE="/dev/input/js0"

For the change to 'take', you then need to log out and back in again. Rebooting is unnecessary."

After doing that, calibrating in jstest-gtk worked.
User avatar
Cholmondely
Archivist
Archivist
Posts: 6212
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre?

Post by Cholmondely »

Would this work for the AppleMac too?

I've two problems.

i) Thrustmaster TFlight Hotas 4 needs a complicated button-press ritual to work fully with the AppleMac. But when Murgh tried it on his AppleMac, it would not work.

ii) Can't get my CH Pro Throttle to be recognised when my CH joysick is plugged in.

Would this help with either?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Sun Jun 20, 2010 6:00 pm

Re: Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre?

Post by mcarans »

Cholmondely wrote: Mon Jun 30, 2025 9:16 am
Would this work for the AppleMac too?

I've two problems.

i) Thrustmaster TFlight Hotas 4 needs a complicated button-press ritual to work fully with the AppleMac. But when Murgh tried it on his AppleMac, it would not work.

ii) Can't get my CH Pro Throttle to be recognised when my CH joysick is plugged in.

Would this help with either?
I am not familiar with Mac, but I suspect that it wouldn't help. Nevertheless, it is an easy change to try as it just involves setting an environment variable.
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Sun Jun 20, 2010 6:00 pm

Re: Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre? (solved)

Post by mcarans »

I discovered that there is another step to actually ensure the calibration from jstest-gdk is saved and to use it subsequently. Run

Code: Select all

sudo jscal-store /dev/input/js0
Then to use the saved calibration, I made a bash script called run_game with:

Code: Select all

#!/bin/bash
jscal-restore /dev/input/js0
cd ${1%/*}
$1
Then for any game including Oolite, I just call

Code: Select all

run_game <PATH_TO_GAME>
If using OoliteStarter <PATH_TO_GAME> is the path to OoliteStarter.
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 346
Joined: Sun Jun 20, 2010 6:00 pm

Re: Does Oolite ignore calibration in jstest-gtk and if so how to set joystick centre? (solved)

Post by mcarans »

If you want to map axes to keyboard keys, you can use antimicrox like this:

Code: Select all

#!/bin/bash
jscal-restore /dev/input/js0
antimicrox --tray &
cd ${1%/*}
$1
I had forgotten that there's a wiki page I wrote on setting up joysticks in Linux (https://wiki.alioth.net/index.php/Linux ... d_Gamepads). I'll update it in due course.
Post Reply