antirez/load81 — pull request #39 by seclorum (2012-03-12 23:29:08+00:00)
Title: Feature: Joystick support for up to 4 Devices.

This patch adds Joystick support to LOAD81. It allows up to 4 devices to be used within the Lua environment, and for that purpose adds a new global Lua table called 'joystick', with fields x, y, and name, where:

x = X-axis value of the joystick
y = Y-axis value of the joystick
name = name of the joystick device

This patch has been mainly targeted at Open Pandora users, where the onboard nubs are featured as independent high-resolution joysticks. For that reason, complete button support is not finished - but will be added in another patch shortly.

Tested on Open Pandora hardware, and Macbook Pro with paired iControlpad controllers. On Open Pandora hardware, joysticks will be named thus:

joystick[1].name = "gpio-keys" (Special feature of Open Pandora, for hardware hackers mostly)
joystick[2].name = "nub0" (The Left nub)
joystick[3].name = "nub1" (The Right nub)