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

Posted by valadil on Super User See other posts from Super User or by valadil
Published on 2010-12-26T23:59:14Z Indexed on 2010/12/27 0:55 UTC
Read the original article Hit count: 273

Filed under:
|
|
|
|

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.

© Super User or respective owner

Related posts about mouse

Related posts about debian