Programming joysticks with linux, part 2

part 1 is here.

Here is how the buttons and axes are presented by the linux joystick drivers for the Logitech Dual Action Rumble and Xbox 360 wired USB controllers:

Logitech Dual Action Rumble, top view.

Logitech Dual Action Rumble, top view.

Logitech Dual Action Rumble, back view.

Logitech Dual Action Rumble, back view.

Xbox 360 controller, top view

Xbox 360 controller, top view

Xbox 360 controller, back view

Xbox 360 controller, back view

~ by scaryreasoner on July 19, 2008.

5 Responses to “Programming joysticks with linux, part 2”

  1. Good articles. Been trying to get my xbox controller to work in Linux on Quake Wars. So far can’t quite get it done. QW uses SDL too but I’m wondering if xpad if missing something or possible the SDL for Linux. I’ve been able to map everything on the xbox controler except left-trigger, right-trigger, and the D-PAD. Quake Wars seems to be looking for buttons and not axises. This is part of the QW config that works in Windows:

    bind “joy1_LEFT_TRIGGER” “_movedown”
    bind “joy1_RIGHT_TRIGGER” “_attack”
    bind “joy1_DPAD_LEFT” “_leanleft”
    bind “joy1_DPAD_RIGHT” “_leanright”
    bind “joy1_DPAD_UP” “_usevehicle” “” “default”
    bind “joy1_DPAD_DOWN” “_usevehicle” “” “vehicle”

    Is there any way to do this?

  2. I don’t know, sounds like a problem with Quake World. From what I can tell all the buttons and axes work from the point of view of the xpad driver, and from user land programs accessing it via /dev/input/jsX and /dev/input/eventY (where X and Y are whatever numbers are the right ones for your system.)

    I think there was another x-box 360 user space driver floating around before the xpad driver got into the kernel, maybe QW is programmed to work with that driver. But, I really don’t know.

  3. Don’t know either. Looks like it does have to do with the QW and and the driver. Are you an xpad developer? If not, do you know the xpad mailing list I’d like to write this up and see if this is an incomptibility issue between the ms and linux driver.

  4. No, I’m not an xpad developer. Looking in the MAINTAINERS file of the linux source, I see this:

    INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
    P: Dmitry Torokhov
    M: dmitry.torokhov@gmail.com
    M: dtor@mail.ru
    L: linux-input@vger.kernel.org
    T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git
    S: Maintained

    The mailing list archive is here:
    http://www.spinics.net/lists/linux-input/

    Hope that helps.

  5. That’s perfect scaryreasoner. Appreciate the help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: