You are not logged in.

#1 2009-02-09 03:26:09

NoOneImportant
Member
From: Deep Southern California
Registered: 2007-02-13
Posts: 178

executing commands with game controller

How can I map commands (such, uname -a for example) to the buttons on my controller?

So far, I've gotten xf86-input-joystick to work with the following in my xorg.conf

Section "InputDevice"
    Identifier "Dualshock2"
    Driver "joystick"
    Option "Device" "/dev/input/js0"
EndSection

and the following in the ServerLayout section

InputDevice    "Dualshock2" "SendCoreEvents"

But for some retarded reason, xorg just seems to consider my controller to be another mouse: I can move the pointer with the arrows, buttons 1, 2, and 3 act as mouse buttons, etc.

I know I set xorg.conf to map keyboard keys to separate buttons, but how do I map commands? For example, I want to map "mpc toggle" to the start button (button 9).

Offline

#2 2009-02-09 03:54:35

NoOneImportant
Member
From: Deep Southern California
Registered: 2007-02-13
Posts: 178

Re: executing commands with game controller

ok, I solved this myself

I just had to remap each button on the controller as another mouse button; for instance

Section "InputDevice"
    Identifier "Dualshock2"
    Driver "joystick"
    Option "Device" "/dev/input/js0"
    Option "MapButton1" "button=9"
    Option "MapButton2" "button=10"
    Option "MapButton3" "button=11"
    Option "MapButton4" "button=12"
    Option "MapButton5" "button=13"
    Option "MapButton6" "button=14"
    Option "MapButton7" "button=15"
    Option "MapButton8" "button=16"
    Option "MapButton9" "button=17"
    Option "MapButton10" "button=18"
    Option "MapButton11" "button=19"
    Option "MapButton12" "button=20"
    Option "MapButton13" "button=21"
    Option "MapButton14" "button=22"
    Option "MapButton15" "button=23"
    Option "MapButton16" "button=24"
EndSection

so, that's that

from there I've been able to map each button to a command using xbindkeys

axis 1 (left stick) controlls the pointing, and the right stick seems to do scrolling

awesome

Offline

#3 2009-02-09 17:41:36

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: executing commands with game controller

NoOneImportant wrote:

But for some retarded reason, xorg just seems to consider my controller to be another mouse: I can move the pointer with the arrows, buttons 1, 2, and 3 act as mouse buttons, etc.

That's what xf86-input-joystick is supposed to do. It's not necessary for normal joystick use. However, I don't know of a program that let's you set up joystick hotkeys off the top of my head, so what you've done with xbindkeys may be easiest.

Offline

#4 2009-02-09 18:23:56

Doc Angelo
Member
From: Germany
Registered: 2007-11-28
Posts: 52

Re: executing commands with game controller

There's also QJoyPad in AUR. It lets you bind gamepad buttons to keyboard and mouse buttons. You can save multiple layouts. Nice for gaming.

Offline

Board footer

Powered by FluxBB