joystick v0.1.0 Joystick

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

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 udev or kernel (uevent) monitor

Link to this section Functions

Get information about a joystick

Link to this function start_link(device, listener)

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 udev or kernel (uevent) monitor.