Documentation ¶
Overview ¶
Package js is a simple API to interact with the joystick (on Linux).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct { // Number is the number given to the axis/button. Number int // Name is the name of the axis/button. Name string // Name is the last known value of the axis/button in the range of [-1..1]. Value float64 // Name is the initial value of the axis/button in the range of [-1..1]. (NOT IMPLEMENTED YET) InitialValue float64 }
Element represents a single axis or button.
type JoystickEvent ¶
JoystickEvent is a single joystick event.
type Js ¶
type Js struct { DevicePath string Name string NumAxes int NumButtons int Axes []Element Buttons []Element // contains filtered or unexported fields }
Js represents a joystick input device.
func (*Js) Read ¶
func (js *Js) Read() (JoystickEvent, error)
Click to show internal directories.
Click to hide internal directories.