[Wylug-discuss] Reading accelerometer from web-app

Paul Brook paul at codesourcery.com
Thu Aug 4 16:57:38 UTC 2011


Anyone know if it's possible to access input devices such as accelerometers or 
joysticks from a web application, i.e. javastript running in a browser?

Primarily interested in Firefox, maybe chrome, on a linux host.  It's a custom 
web-app that can be controlled either via keyboard, or via custom motion 
sensors.  I'm writing the driver for the input device, so am flexible on the 
exact API.  Browser plugins acceptable, but not ideal.  Ideally I'd get full 
3D direction information, but simple button presses are better than nothing.

Plan B is to make the device appear as a keyboard and send keypresses 
(probably the same ones a user without the sensor hardware would use).  
Obviously this is sub-optimal as the sensors are liable to cause havoc it left 
enabled when switching to a different application.

Paul



More information about the Wylug-discuss mailing list