Open GoogleCodeExporter opened 9 years ago
I realise this is a really old report, but I had the same issue using a
Swordfish PS3 clone / PC controller on Ubuntu. 'Hat' events weren't handled
properly, so if your joystick has hats (
http://en.wikipedia.org/wiki/Joystick#Hat_switch ) jkeys would fail as soon as
a hat event occurred.
Attached is a patch for joystick.py that fixes this issue and allows hats to be
configured by combining two axes in a .joy file as follows:
<!-- DPad -->
<axis number="4" low="Left" high="Right" />
<axis number="5" low="Down" high="Up" />
<hat number="0" x="4" y="5" />
I wrote the patch some time ago, and can't remember all the details, but if
there is interest I can provide more info and examples. There may be a better
way to configure joystick hats, but this works for my controller.
Hope this helps someone!
Original comment by charles....@gmail.com
on 17 Sep 2011 at 6:24
Attachments:
I tried to set the gamepade (saitek 580) for playing teeworlds via jkeys
command and config file (attached file tee.joy). This works only for a few
button presses, then I get the same error you descripted here. I'd like to test
your hat.patch, but don't know how. My gamepade has 6 axes and 13 buttons.
Could you please give some more info?
Original comment by ales.raz...@gmail.com
on 7 Dec 2011 at 7:47
Attachments:
Hi there,
If you are using a Linux OS and already have jkeys installed,
1) download the hat.patch file into the 'jkeys-read-only' directory
2) open up a command line shell and cd to jkeys-read-only
3) type:
patch < hat.patch
That should modify the joystick.py file to fix the error for you so at least
jkeys runs without falling over.
The controller you are using looks similar to mine, although the axis are
probably assigned different numbers. I am guessing it is your d-pad that is the
hat that is causing the problem and from the tee.joy file axis 0 and 1 are l/r
and up/down, so try this in your tee.joy config:
<axis number="0" low="a" high="d" />
<axis number="1" low="s" high="w" />
<hat number="0" x="0" y="1" />
Let me know if you have trouble with the patch command, and whether the
suggested config works! Good luck :)
Original comment by charles....@gmail.com
on 8 Dec 2011 at 11:44
Original issue reported on code.google.com by
dhruva.s...@gmail.com
on 13 Jul 2010 at 4:41