LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 07-08-2004, 11:44 PM   #1
Dr Twox
LQ Newbie
 
Registered: Jul 2004
Location: Sunshine Coast, Australia
Distribution: LFS, Debian Woody, Mandrake
Posts: 6

Rep: Reputation: 0
Post Possible gamepad hardware bug? Requesting testers.


I'm hacking together a console app that uses a joystick/gamepad for control. I've tried code from the linux joystick utils, code from the kernel docs, joyd, joy2key and mpcstick and they all suffer the problem outlined below in Test 1. Before I run screaming into the hills (and over to the programming forum with my code), I want to test some hardware and make sure this isn't just me and my system :P (This shouldn't take more than 5 minutes of your time.)

You will need:
A gamepad that is known to work. (Mine's a Thustmaster 12 button USB)
The linux joystick utils (specificaly jstest)
It would help if you posted your distro/kernel version too. (I'm LFS5.1, 2.6.5)


TEST 1: (The Problem)
1) In a console/terminal window run:
$ jstest --normal /dev/js0 (or js1, js2 etc, depending on your setup)

2)Look the values of Axes. It should look like this:
Axes: 0: 0 1: 0 Buttons:......... {snipped}
The 0 values for axes0 (left and right) and axes1 (up and down) indicate you aren't pressing anything.

3) Press and hold a direction (e.g. Up, Down). The value for the Axes will change - all good so far!

4) Continue holding the axes and press ctrl+c to close jstest

5) Release the axes and re-run the jstest --normal /dev/js0 code.

6) Note the values of Axes now - does jstest still report the axes as being pressed even though it's not? Mine does. Try the same test using buttons, not the axes - what happens?


TEST 2:
1) Open two console/terminal windows and run (in both!)
$jstest --normal /dev/js0

2) In console 1, repeat steps 3 and 4 from Test 1. Release the axes.

3) If you look at console 2, you can see the axes is reported as 0 (nothing pressed) - just like it should.

4) Re-run jstest in console 1 and, as expected, the axes is reported correctly, unlike in Test 1. Why does the joystick/gamepad not reset it's values in Test 1?

I'm guessing this might just be my pad/system, because surely someone smarter than me would have noticed this long before I did :P

Last edited by Dr Twox; 07-09-2004 at 09:23 PM.
 
Old 07-09-2004, 09:24 PM   #2
Dr Twox
LQ Newbie
 
Registered: Jul 2004
Location: Sunshine Coast, Australia
Distribution: LFS, Debian Woody, Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
bump
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for beta testers grizzly General 5 03-20-2004 12:24 PM
Bug in MS Access Code Linh Programming 2 10-09-2003 03:47 PM
Bug in c code calling bash code Linh Programming 11 08-12-2003 05:27 AM
Bug in C code Linh Programming 3 07-07-2003 07:06 PM
Requesting Packet Sniffer source code Volcom Programming 3 07-05-2003 12:48 PM


All times are GMT -5. The time now is 12:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration