Hi,
I’m using kernel 2.4.22 and an adapted xbox pad connected throgh USB
with a driver from the xbox-linux project, but I’m on a PC.
I did some more testing. It seems SDL does actually find them, it was
just I was expecting it to behave the same whether it was though a 'js’
or ‘event’ device and I thought hats went sometimes undetected, sorry.
When I load joydev, SDL reports 10 buttons and 14 axes, which is good
-but not ‘correct’-. However when I use evdev, I get 10 buttons, 6 axes
and 4 hats reported from SDL. Which is ‘correct’ in the sense that
that’s what the pad driver reports.
I prefer how SDL behaves when using the ‘js’ driver, because when the
hats (which physically are analog buttons) are reported as axes I can
get their abolute position, not just a bitfield of positions.
The reason the driver maps the buttons to hats, I guess, is the lack of
more meaningful identifiers (in linux/input.h)
Is there a way of having the same behavior through ‘js’ and 'event’
devices? Or, perhaps, is there a way to get the analog value of the hats
from within SDL?
Thanks
DrirrOn Fri, 2003-12-26 at 06:37, Ryan C. Gordon wrote:
Searching through the sources I found they are explicitly ignored
(SDL_sysjoystick.c, lines 419 - 423)
We don’t handle hats in that loop, since it’s just to configure the
axes…we handle them in the loop right below it. (line 449, etc).
What joystick and interface (usb? gameport? serial?) and kernel are you
using? Are you sure the kernel is reporting them as hats and not axes
when using the event interface? Perhaps the kernel’s not reporting them
at all in that case?
It may be a bug in SDL, but it might not be in this instance, too.
–ryan.