You are correct on the axes 2 sicks make 4 axes (w/ an extra hat then there
are 6 total)
SDL Reports center to be 0,0
maxX & maxY are 32767 and minX & minY are -32767
for a total range of 65535 (don’t forget to count 0)
The hat button axes will be 0 or 32767 (or -32767), but not in between, unless
they are not true hat buttons (on or off)
SDL Does have special recognition of hat buttons, which will be manifest in
the next release of SDLJoytest
I’m my newest code I supply support for 2 axis pairs
pressing 1 will select axis pair 0 or the defualt x,y axis
pressing 2 will select axis pair 1 (axis 2, 3 in sdl)
*note, from what I know, SDL has NO knowledge of axis pairs, only of
individual axes (so i don’t seem ambigious)
if you want just text output then you can try the program found in John R.
Hall’s: Programming Linux Games, which is availible for free download. ( I
forget where exactly, do a google/linux search for it, or try the publisher
at www.nostarch.com). The sample joystick program there uses sdl still, but
doesn’t use a graphical intrface to test the joystick. (although, for some
reason, it still throws up a window)
also, you said that no all the buttons on the PS2 controller were showing up?
This may be because there is not enough room on the screen ,I wasn’t thinking
of the TV. But it should detect them (and draw them, you just can’t see’em);
can you email me a screen shot from the console part of the code (where it
detects the joysticks and displays their information)
at aristoidaneel at yahoo.com
I’ll have this button bug fixed by next release as well.
w/ multiple columns of lights, based on the current resolution (the maxY)
Other improvements planned for the near future are:
- a ‘./configure’ (autoconf) script for building
(including the ability to install)
- a man page
- modularized source code
anyother suggestions are welcome as well.
Samuel.On Sunday 23 February 2003 08:13 am, J. Grant wrote:
This sounds great!
Thanks, I hope it will be more great when finished
If you would also be so kind as to send me some technical details on the
PS2Linux Joysticks (as much as you have would be great).
It has 10 buttons, 1 d-pad “hat”, 2 analog sticks, which are represented
as x,y as in the linux driver etc.
I do have a question, in struct _SDL_Joystick, an analog stick is
represented as 2 axis it appears. So if my joystick has 1 stick
naxes=2, and so I believe 2 analog sticks naxes=4. Is this correct? Or
is only one analog stick (with 2 axis) the only analog function supported.
Something that would be useful would be a purely stdio SDLJoytest mode.
So I can code/test/debug quicker (currently I use modified
testjoystick.c for this).
I’m also thinking about the best way of supporting the extra pressure
sensitive buttons on the DualShock2 controller.
SDL mailing list
SDL at libsdl.org