Difference between revisions of "Joy2key"

From ArchWiki
Jump to: navigation, search
m (This is an info dump at this point. It needs to take some shape and focus on joy2key.)
m
Line 1: Line 1:
==joy2key - make Logitech Cordless RumblePad 2 "hat" (a.k.a. d-pad) work in XBMC again==
+
===Use a joystick/gamepad to control applications which accept keyboard commands===
 +
<br>[http://aur.archlinux.org/account.php?Action=AccountInfo&ID=10404 I]use [http://sourceforge.net/projects/joy2key/ joy2key] to work around issues with the Logitech Cordless RumblePad 2 "hat" (a.k.a. d-pad) in XBMC.<br>
 
References to the source where I learned about this:
 
References to the source where I learned about this:
 
[http://hans.fugal.net/blog/2007/06/02/joystick-hat-in-x-plane-in-linux/]
 
[http://hans.fugal.net/blog/2007/06/02/joystick-hat-in-x-plane-in-linux/]
 
''"Linux reports joystick hats as axes, because that's what the device reports them as."''
 
''"Linux reports joystick hats as axes, because that's what the device reports them as."''
<br><br>
+
 
XBMC 10.0 or probably a recent Arch update (SDL?) broke the joystick hat functionality for me.
+
 
On XBMC startup, xbmc.log shows 0 hats and 6, instead of 4, axes:
+
[http://xbmc.org/ XBMC] 10.0 or probably a recent Arch update (SDL?) broke the joystick hat functionality for me.
 +
On XBMC 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: 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
 
  17:00:36 T:3020363648 M:1703337984  NOTICE: Details: Total Axis: 6 Total Hats: 0 Total Buttons: 12
<br>
+
 
My solution was to install [http://aur.archlinux.org/packages.php?ID=32517 joy2key] from [[AUR]]. Here's my config:
+
 
 +
My solution was to install [http://aur.archlinux.org/packages.php?ID=32517 joy2key] from [[AUR]]. Here's my config which could potentially save you hours of frustration or fun, depending how you look at it:
 
  #
 
  #
 
  # ~/.joy2keyrc
 
  # ~/.joy2keyrc
Line 40: Line 43:
 
   
 
   
 
  # EoF
 
  # EoF
<br>
+
 
joy2key needs to start after XBMC to be able to see its window. Here's my standalone XBMC box config:
+
 
 +
joy2key needs to start '''after''' XBMC to be able to see its window. Here's my XBMC standalone system config:
 
  #
 
  #
 
  # ~/.xinitrc
 
  # ~/.xinitrc
Line 53: Line 57:
 
   
 
   
 
  # Start XBMC.
 
  # Start XBMC.
  ck-launch-session xbmc-standalone --nolirc
+
  ck-launch-session xbmc-standalone
 
   
 
   
 
  # EoF
 
  # EoF
More info on [http://wiki.xbmc.org/index.php?title=HOW-TO_install_XBMC_for_Linux_on_Arch_Linux,_a_Step-by-Step_Guide how to install XBMC on Arch]
+
 
<br>
+
 
<br>
+
And here is my joy2key config section for controlling [[Boxee-source]]:
And here is my joy2key config section for [[Boxee-source]]:
+
 
  START boxee
 
  START boxee
 
  -X
 
  -X
Line 65: Line 68:
 
  # .......1.2......3......4.5....6.....7...........8............9.0.1.2
 
  # .......1.2......3......4.5....6.....7...........8............9.0.1.2
 
  -buttons v Return Escape c Left Right bracketleft bracketright i z s h
 
  -buttons v Return Escape c Left Right bracketleft bracketright i z s h
<br>
+
 
 +
 
 
Part of .xinitrc which alternates between launching XBMC and Boxee:
 
Part of .xinitrc which alternates between launching XBMC and Boxee:
 
  (sleep 5 && joy2key "XBMC Media Center" -config xbmc) &
 
  (sleep 5 && joy2key "XBMC Media Center" -config xbmc) &
  ck-launch-session xbmc-standalone --nolirc
+
  ck-launch-session xbmc-standalone
 
   
 
   
 
  (sleep 5 && joy2key "Boxee" -config boxee) &
 
  (sleep 5 && joy2key "Boxee" -config boxee) &
 
  ck-launch-session /opt/boxee/run-boxee-desktop
 
  ck-launch-session /opt/boxee/run-boxee-desktop
<br>
+
 
 +
 
 
This gets respawned over and over from /etc/inittab:
 
This gets respawned over and over from /etc/inittab:
 
  x:5:respawn:/bin/su xbmc -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"
 
  x:5:respawn:/bin/su xbmc -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"
 +
 +
 +
More info on [http://wiki.xbmc.org/index.php?title=HOW-TO_install_XBMC_for_Linux_on_Arch_Linux,_a_Step-by-Step_Guide how to install XBMC on Arch]

Revision as of 01:00, 18 March 2011

Use a joystick/gamepad to control applications which accept keyboard commands


Iuse joy2key to work around issues with the Logitech Cordless RumblePad 2 "hat" (a.k.a. d-pad) in XBMC.
References to the source where I learned about this: [1] "Linux reports joystick hats as axes, because that's what the device reports them as."


XBMC 10.0 or probably a recent Arch update (SDL?) broke the joystick hat functionality for me. On XBMC 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 which could potentially save you hours of frustration or fun, depending how you look at it:

#
# ~/.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!
#          blank = special
# 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


joy2key needs to start after XBMC to be able to see its window. Here's my XBMC standalone system config:

#
# ~/.xinitrc
#

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

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

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

# EoF


And here is my joy2key config section for controlling Boxee-source:

START boxee
-X
-axis blank blank Page_Up Page_Down blank blank plus minus Left Right Up Down
# .......1.2......3......4.5....6.....7...........8............9.0.1.2
-buttons v Return Escape c Left Right bracketleft bracketright i z s h


Part of .xinitrc which alternates between launching XBMC and Boxee:

(sleep 5 && joy2key "XBMC Media Center" -config xbmc) &
ck-launch-session xbmc-standalone

(sleep 5 && joy2key "Boxee" -config boxee) &
ck-launch-session /opt/boxee/run-boxee-desktop


This gets respawned over and over from /etc/inittab:

x:5:respawn:/bin/su xbmc -l -c "/bin/bash --login -c /usr/bin/startx >/dev/null 2>&1"


More info on how to install XBMC on Arch