Joystick (joystick v0.2.1) View Source
Simple wrapper to get Linux Joystick events.
Usage
iex()> {:ok, js} = Joystick.start_link(0, self())
iex()> flush()
{:joystick, %Joystick.Event{number: 1, timestamp: 1441087318, type: :axis, value: -60}}
{:joystick, %Joystick.Event{number: 4, timestamp: 1441087318, type: :axis, value: -5}}
iex()> Joystick.info(js)
%{axes: 8, buttons: 11, name: 'Microsoft X-Box One pad', version: 131328}
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Get information about a joystick
Start listening to joystick events.
Stop a running joystick instance.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Get information about a joystick
Start listening to joystick events.
device
- a number pointing to the js file.- for example 0 would evaluate to "/dev/input/js0"
listener
- pid to receive events
Stop a running joystick instance.