#!/usr/bin/env ruby require 'rubygems' require 'joystick' site='localhost:3000/' #site='rubypython.railsplayground.net/' def go_to (f,st) p st f.goto(st) end begin Joystick::Device::open('/dev/input/js0') { |joy| puts "Joystick: #{joy.name}", "Axes / Buttons : #{joy.axes} / #{joy.buttons}", loop { ev = joy.ev p "type #{ev.type} num #{ev.num} val #{ev.val}" } } rescue puts 'cannot find joystick at /dev/input/js0' end