How do I use key combinations on an axis on a joystick in xorg?

1

I'm using xserver-xorg-input-joystick on Debian Stable so I can use a joystick in place of the mouse. I have mouse movement working correctly, but got stuck trying to add functions for some other keys.

These work:

#Left stick
#Pointer
Option "MapAxis1"   "mode=relative axis=1.5x"
Option "MapAxis2"   "mode=relative axis=1.5y"

#Right stick
#Arrow keys
Option "MapAxis4"   "mode=relative  keylow=Left keyhigh=Right"
Option "MapAxis5"   "mode=relative  keylow=Up   keyhigh=Down"

But when I try to make key combos (so I can navigate windows and screens in xmonad) I have no luck.

#dpad
#xmonad focus
#up/down toggle window.  l/r choose screen.
Option "MapAxis8" "mode=relative    keylow=Super_L,k    keyhigh=Super_L,j"
Option "MapAxis7" "mode=relative    keylow=Super_L,w    keyhigh=Super_L,e"

I've also tried Super_R, plain old Super, Meta, and mod4mask, and anything else I can think of. These buttons print the letter, but don't appear to hold down the modifying key. The exception to that is shift. If I specify Shift_L or Shift_R, I get a capital letter.

xev indicates that modifier keys are being pressed. If I lower Axis8, I get press Super_L, press k, release k, release Super_L. That looks like it should be working. Maybe this is an xmonad problem and not a joystick driver one?

I'm also having trouble with getting an axis to use other XF86 keys:

# triggers                                                                            
# song selection
Option "MapAxis3" "mode=relative keylow=none keyhigh=XF86AudioForward"
Option "MapAxis6" "mode=relative keylow=none keyhigh=XF86AudioBack"

That does nothing. Any idea why?

If it turns out that this isn't something I can do on an axis, but would work with a button, is there a way to treat my joysticks as buttons?

Also, if anyone has suggestions for the other 5 buttons I'll have left after mouse buttons are bound, I'm listening.

valadil

Posted 2010-12-26T23:59:14.047

Reputation: 443

I am trying to do the same thing as you. I can not get the stick to move the mouse.could you give the rest of your xorg.conf that pertains to this. JerryCLunsford – None – 2011-04-21T07:43:28.087

@Jerry, I wouldn't mind sharing but mine stopped working entirely :-\ – valadil – 2011-04-21T13:27:35.650

Answers

2

I confess I don't know debian at all, but it sounds like you covered the bases and that you have confirmed that the button is being simulated properly.

I found this link:

http://zythmer.acyclic.org/files/docs/xev_and_xmodmap

with quote that was interesting:

Typically a good choice is the Windows key since there are no binds to it by default [emphasis mine].

I didn't look carefully at the details, but it seems to walk through the process of binding it for xmodmap

horatio

Posted 2010-12-26T23:59:14.047

Reputation: 3 345