[Solved] analog joystick dead zone
Moderators: winston, another_commander, Getafix
[Solved] analog joystick dead zone
Hi! Does someone know how to set the dead zone in analog joysticks on gnu-linux?
I use a Logitech extreme 3d pro. I roll and pitch with the x and y axis, and yaw twisting the stick. My problem is that the twist is very sensitive and it's too easy to activate the yaw movement by mistake.
I already searched for similar problems, but all I was able to find was windows related, i.e.: install the logitech utilities.
I use a Logitech extreme 3d pro. I roll and pitch with the x and y axis, and yaw twisting the stick. My problem is that the twist is very sensitive and it's too easy to activate the yaw movement by mistake.
I already searched for similar problems, but all I was able to find was windows related, i.e.: install the logitech utilities.
Last edited by Getafix on Sun Aug 19, 2012 11:54 am, edited 2 times in total.
Reason: Capitalized solved to Solved.
Reason: Capitalized solved to Solved.
- CommRLock78
- ---- E L I T E ----
- Posts: 1138
- Joined: Sat Apr 07, 2012 7:35 pm
- Location: US
- Contact:
Re: analog joystick dead zone
I guess the first question to ask is what distro are you using?Tichy wrote:Hi! Does someone know how to set the dead zone in analog joysticks on gnu-linux?
I use a Logitech extreme 3d pro. I roll and pitch with the x and y axis, and yaw twisting the stick. My problem is that the twist is very sensitive and it's too easy to activate the yaw movement by mistake.
I already searched for similar problems, but all I was able to find was windows related, i.e.: install the logitech utilities.
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
Re: analog joystick dead zone
I'm using Arch
- CommRLock78
- ---- E L I T E ----
- Posts: 1138
- Joined: Sat Apr 07, 2012 7:35 pm
- Location: US
- Contact:
Re: analog joystick dead zone
I'm a couple years from Arch yet (I'm still learning with Mint in the Debian branch), but I found this site. I hope it helps:
http://www.thelinuxblog.com/linux-man-pages/4/joystick
http://www.thelinuxblog.com/linux-man-pages/4/joystick
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
Re: analog joystick dead zone
I installed the X11 driver (xf86-input-joystick). When using the joystick in X11 as mouse and keyboard, the deadzone option works, but looks like the game ignores it. Maybe oolite hooks directly to the kernel driver, not the x11 input device.
Re: analog joystick dead zone
Problem solved! You need jscal and jstest ("joyutils" package in Arch's AUR). There's also al frontend called jstest-gtk.
Calibrate and set the dead zone with jstest-gtk. We need to set CenterMin and CenterMax values.
My settings:
Then you need to save these values, in order to reload them every time you plug the joystick. This is done by making jscal dump the actual values in a script file:
Edit the file and add this on top of it
Make the script executable (chmod +x jscal.sh) and move it in /usr/local/bin
Now, we need to make this to automatically load every time we plug in the device. To do so, we'll make an udev rule.
Create a file in /etc/udev/rules.d and name it 85-jscal.rules (or something similar).
This is mine
If a device matching these rules is plugged, the script specified in RUN+= will be executed. You need to adapt it to your device. To find your idVendor and idProduct, launch
or, with lsusb (Bus ... Device ...: ID vedor:product Name):
The last thing to do, is to export an enviroinment variable that says to the SDL libraries that we are using /dev/input/js0 as joystick. Without it, Oolite would ignore our settings.
Put in your .profile or .bashrc or where you usually set your evniroinment variables that line
ps. I hope that the guide is understandable. And forgive my grammar: english is not my native language.
Calibrate and set the dead zone with jstest-gtk. We need to set CenterMin and CenterMax values.
My settings:
Then you need to save these values, in order to reload them every time you plug the joystick. This is done by making jscal dump the actual values in a script file:
Code: Select all
jscal -p /dev/input/js0 > jscal.sh
Code: Select all
#!/bin/bash
Now, we need to make this to automatically load every time we plug in the device. To do so, we'll make an udev rule.
Create a file in /etc/udev/rules.d and name it 85-jscal.rules (or something similar).
This is mine
Code: Select all
SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c215", ACTION=="add", RUN+="/usr/local/bin/jscal.sh"
Code: Select all
udevadm info --attribute-walk --name /dev/input/js0
Code: Select all
Bus 005 Device 011: ID 046d:c215 Logitech, Inc. Extreme 3D Pro
Put in your .profile or .bashrc or where you usually set your evniroinment variables that line
Code: Select all
export SDL_JOYSTICK_DEVICE=/dev/input/js0
- CommRLock78
- ---- E L I T E ----
- Posts: 1138
- Joined: Sat Apr 07, 2012 7:35 pm
- Location: US
- Contact:
Re: [solved] analog joystick dead zone
I'm glad you got it figured out ; sorry I couldn't be of much assistance.
"I'll laser the mark all while munching a fistful of popcorn." - Markgräf von Ededleen, Marquess, Brutal Great One, Assassins' Guild Exterminator
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
---------------------------
At the helm of the Caduceus Omega, 'Murderous Morrígan'
Re: [solved] analog joystick dead zone
No problem
- captain122
- Above Average
- Posts: 19
- Joined: Sun Sep 28, 2008 12:46 pm
- Location: You really don't need to know that
Re: [solved] analog joystick dead zone
Wow. I have been searching for an answer to that issue for years. I just rediscovered my account here and the first thing I see is just what I needed. I am very impressed and happy! (Also amazed at how many of the old faces are still around and how many are long gone!)
-
- Above Average
- Posts: 16
- Joined: Mon Mar 24, 2008 5:50 pm
Re: [Solved] analog joystick dead zone
Sorry for thread necromancy, but this solution is worth a sticky.
Calibrating joysticks in linux is non obvious and is not helped that SDL by default ignores your calibration (without setting SDL_JOYSTICK_DEVICE to /dev/input/jsX).
Calibrating joysticks in linux is non obvious and is not helped that SDL by default ignores your calibration (without setting SDL_JOYSTICK_DEVICE to /dev/input/jsX).
Re: [Solved] analog joystick dead zone
Does this fix work in windows at all, or purely Linux?
Re: [Solved] analog joystick dead zone
Only gnu-linux.