Oolite Bulletins

For information and discussion about Oolite.
It is currently Sat Dec 15, 2018 4:00 am

All times are UTC




Post new topic  Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Fri Aug 03, 2012 1:33 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
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.


Last edited by Getafix on Sun Aug 19, 2012 11:54 am, edited 2 times in total.
Capitalized solved to Solved.


Top
   
PostPosted: Fri Aug 03, 2012 10:23 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Apr 07, 2012 7:35 pm
Posts: 1132
Location: US
Quote:
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 guess the first question to ask is what distro are you using?

_________________
"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'


Top
   
PostPosted: Fri Aug 03, 2012 10:34 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
I'm using Arch


Top
   
PostPosted: Fri Aug 03, 2012 11:37 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Apr 07, 2012 7:35 pm
Posts: 1132
Location: US
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

_________________
"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'


Top
   
PostPosted: Sat Aug 04, 2012 9:08 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
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.


Top
   
PostPosted: Sat Aug 04, 2012 11:49 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
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:
Image

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:
jscal -p /dev/input/js0 > jscal.sh
Edit the file and add this on top of it
Code:
#!/bin/bash
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
Code:
SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c215", ACTION=="add", RUN+="/usr/local/bin/jscal.sh"
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
Code:
udevadm info --attribute-walk --name /dev/input/js0
or, with lsusb (Bus ... Device ...: ID vedor:product Name):
Code:
Bus 005 Device 011: ID 046d:c215 Logitech, Inc. Extreme 3D Pro
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
Code:
export SDL_JOYSTICK_DEVICE=/dev/input/js0
ps. I hope that the guide is understandable. And forgive my grammar: english is not my native language. :)


Top
   
PostPosted: Sat Aug 04, 2012 8:22 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Apr 07, 2012 7:35 pm
Posts: 1132
Location: US
I'm glad you got it figured out :mrgreen: ; 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'


Top
   
PostPosted: Sat Aug 04, 2012 11:51 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
No problem ;)


Top
   
PostPosted: Wed Aug 08, 2012 2:50 am 
Offline
Above Average
Above Average
User avatar

Joined: Sun Sep 28, 2008 12:46 pm
Posts: 19
Location: You really don't need to know that
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!)


Top
   
PostPosted: Thu Jan 10, 2013 3:22 pm 
Offline
Above Average
Above Average

Joined: Mon Mar 24, 2008 5:50 pm
Posts: 16
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).


Top
   
PostPosted: Sat Feb 16, 2013 7:57 am 
Offline
Above Average
Above Average

Joined: Thu Nov 03, 2011 3:30 pm
Posts: 26
Does this fix work in windows at all, or purely Linux?


Top
   
PostPosted: Sat Feb 16, 2013 9:30 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Jul 11, 2012 5:48 pm
Posts: 345
Only gnu-linux. :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited