Difference between revisions of "Joy2key"

From ArchWiki
Jump to: navigation, search
m
m
Line 21: Line 21:
 
  -X
 
  -X
 
  # -axis <axis0min> <axis0max> <axis1min> <axis1max> ...
 
  # -axis <axis0min> <axis0max> <axis1min> <axis1max> ...
  #      0 = left analog [Left Right]
+
  #      0 = left analog stick X-axis
  #      1 = left analog [Up Down]
+
  #      1 = left analog stick Y-axis
  #      2 = right analog [Left Right]
+
  #      2 = right analog stick X-axis
  #      3 = right analog [Up Down]
+
  #      3 = right analog stick Y-axis
  #      4 = hat (d-pad) [Left Right]
+
  #      4 = hat (d-pad) X-axis
  #      5 = hat (d-pad) [Up Down]
+
  #      5 = hat (d-pad) Y-axis
 
  #
 
  #
  # actions: Left/Right/Up/Down (arrows) - first letter capital!
+
  # actions: Left/Right/Up/Down (arrow keys) - first letter capital!
 
  #          plus/minus (ASCII characters) - lower case!
 
  #          plus/minus (ASCII characters) - lower case!
 
  # more info in /usr/include/X11/keysymdef.h
 
  # more info in /usr/include/X11/keysymdef.h

Revision as of 01:25, 11 March 2011

[DRAFT]

Getting Logitech Cordless RumblePad 2 "hat" (a.k.a. d-pad) to work in XBMC


XBMC 10.0 or maybe a recent Arch update broke this for me. On startup xbmc.log shows 0 hats and 6 instead of 4 axes:

17:00:36 T:3020363648 M:1703337984  NOTICE: Enabled Joystick: Logitech Logitech Cordless RumblePad 2
17:00:36 T:3020363648 M:1703337984  NOTICE: Details: Total Axis: 6 Total Hats: 0 Total Buttons: 12


My solution was to install joy2key from AUR. Here's my config:

#
# ~/.joy2keyrc
#

COMMON
-dev /dev/input/js0
-thresh -16383 16383 -16383 16383 -16383 16383 -16383 16383 -16383 16383 -16383 16383
#-autorepeat 5
#-deadzone 50

START xbmc
-X
# -axis <axis0min> <axis0max> <axis1min> <axis1max> ...
#       0 = left analog stick X-axis
#       1 = left analog stick Y-axis
#       2 = right analog stick X-axis
#       3 = right analog stick Y-axis
#       4 = hat (d-pad) X-axis
#       5 = hat (d-pad) Y-axis
#
# actions: Left/Right/Up/Down (arrow keys) - first letter capital!
#          plus/minus (ASCII characters) - lower case!
# more info in /usr/include/X11/keysymdef.h
#
# .....0..........1.......2..........3..........4..........5......
#-axis Left Right Up Down minus plus plus minus Left Right Up Down
-axis blank blank blank blank blank blank blank blank Left Right Up Down

# EoF


Dead zone can also be controlled in XBMC config: ~/.xbmc/userdata/advancedsettings.xml

<advancedsettings>
    <controllerdeadzone>0.4</controllerdeadzone>
</advancedsettings>


My config for standalone XBMC:

#
# ~/.xinitrc
#

# Enable Ctrl+Alt+Bksp.
setxkbmap -option terminate:ctrl_alt_bksp &

# After a delay, start joy2key with XBMC config.
(sleep 3 && joy2key "XBMC Media Center" -config xbmc) &

# Start XBMC.
ck-launch-session xbmc-standalone --nolirc

# EoF