Versions in this module Expand all Collapse all v1 v1.0.0 Feb 16, 2019 Changes in this version + var ErrControllerIsConnected = errors.New("ds4: controller is already connected") + var ErrControllerIsListening = errors.New("ds4: controller is already listening for events") + var ErrControllerIsNotConnected = errors.New("ds4: controller is not connected") + var ErrInvalidConnectionType = errors.New("ds4: can't detect connection type") + type Accelerometer struct + X int16 + Y int16 + Z int16 + type Battery struct + Capacity byte + IsCableConnected bool + IsCharging bool + type Callback func(data interface{}) error + type ConnectionType uint + const ConnectionTypeBluetooth + const ConnectionTypeNone + const ConnectionTypeUSB + func (t ConnectionType) String() string + type Controller struct + func Find() []*Controller + func NewController(device Device) *Controller + func (c *Controller) Connect() error + func (c *Controller) ConnectionType() ConnectionType + func (c *Controller) Disconnect() error + func (c *Controller) Led(led *led.Led) error + func (c *Controller) Listen() error + func (c *Controller) Name() string + func (c *Controller) Off(event Event) + func (c *Controller) On(event Event, fn Callback) + func (c *Controller) ProductID() uint16 + func (c *Controller) Rumble(rumble *rumble.Rumble) error + func (c *Controller) String() string + func (c *Controller) VendorID() uint16 + type Device interface + Close func() error + GetFeatureReport func(code byte) ([]byte, error) + Manufacturer func() string + Open func() error + Path func() string + Product func() string + ProductID func() uint16 + Read func(b []byte) (int, error) + Release func() uint16 + Serial func() string + VendorID func() uint16 + Write func(b []byte) (int, error) + type Event string + const EventAccelerometerUpdate + const EventBatteryUpdate + const EventCirclePress + const EventCircleRelease + const EventCrossPress + const EventCrossRelease + const EventDPadDownPress + const EventDPadDownRelease + const EventDPadLeftPress + const EventDPadLeftRelease + const EventDPadRightPress + const EventDPadRightRelease + const EventDPadUpPress + const EventDPadUpRelease + const EventGyroscopeUpdate + const EventL1Press + const EventL1Release + const EventL2Press + const EventL2Release + const EventL3Press + const EventL3Release + const EventLeftStickMove + const EventOptionsPress + const EventOptionsRelease + const EventPSPress + const EventPSRelease + const EventR1Press + const EventR1Release + const EventR2Press + const EventR2Release + const EventR3Press + const EventR3Release + const EventRightStickMove + const EventSharePress + const EventShareRelease + const EventSquarePress + const EventSquareRelease + const EventTouchpadPress + const EventTouchpadRelease + const EventTouchpadSwipe + const EventTrianglePress + const EventTriangleRelease + type Gyroscope struct + Pitch int16 + Roll int16 + Yaw int16 + type Stick struct + X byte + Y byte + type Touch struct + IsActive bool + X byte + Y byte + type Touchpad struct + Press bool + Swipe []Touch