popcornmix/omxplayer — pull request #23 by mdraves91 (2013-07-27 04:01:34+00:00)
Title: Joystick support!

Hey all, I've added joystick support. You can now bind actions in a keyconfig file to one or more joysticks! All of the changes are explained in the commit comment and the changes to the readme, but I thought I'd highlight the most important one (binding joysticks in a key config) here.

The short version of it is to bind a joystick axis you use the following syntax:

ACTION:js /path/to/js a[number][+-]

and the following for a button:

ACTION:js /path/to/js b[number]

[number] is just the number of the axis or button (watch out, they can overlap! There can exist an axis 0 and a button 0), and [+-] indicates the direction of movement of the axis that should trigger the event. If a direction is missing, it won't work.

I've tested it a bit and it all looks okay, but I'd appreciate it if anyone else with a joystick handy could test it out too. Some cases that I've tested that work properly:
[*]Multiple joysticks
[*]No joysticks
[*]Having multiple joysticks plugged in but only one (or none) defined.[*]Having multiple joysticks defined in keyconfig but not all of them exist (i.e. some are unplugged). The joysticks that ARE plugged in work fine.