antirez/load81 — pull request #52 by seclorum (2012-03-17 22:26:08+00:00)
Title: Feature: Joystick support for up to 8 Devices.

I have re-implemented Joystick support.

This patch adds Joystick support to LOAD81. It allows up to 8 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 includes Joystick button support (1-button per Joystick, for now..)

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)
joystick[2].button = 0 or 1, depending on if button = up or button = down