Documentation
¶
Index ¶
- Constants
- type Accelerometer
- type Battery
- type DualShock4
- type Gamepad
- type GamepadEvent
- type GamepadEventAction
- type GamepadEventChannel
- type GamepadEventType
- type GamepadProjection
- type Gyroscope
- type Keyboard
- type KeyboardEvent
- type KeyboardEventAction
- type KeyboardEventChannel
- type KeyboardEventType
- type KeyboardHard
- type KeyboardProjection
- type Stick
- type Touch
- type Touchpad
Constants ¶
View Source
const BOTTOM float64 = 90
View Source
const BOTTOM_LEFT float64 = 135
View Source
const BOTTOM_RIGHT float64 = 45
View Source
const GamepadEventChannelSize = 1000
View Source
const KeyboardEventChannelSize = 1000
View Source
const LEFT float64 = 180
View Source
const RIGHT float64 = 0
View Source
const TOP float64 = 270
View Source
const TOP_LEFT float64 = 225
View Source
const TOP_RIGHT float64 = 315
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accelerometer ¶
type DualShock4 ¶
type DualShock4 struct { GamepadChannel GamepadEventChannel // contains filtered or unexported fields }
func NewDualShock4 ¶
func NewDualShock4() *DualShock4
func (*DualShock4) EventChannel ¶
func (ds *DualShock4) EventChannel() *GamepadEventChannel
func (*DualShock4) Projection ¶
func (ds *DualShock4) Projection() *GamepadProjection
func (*DualShock4) Start ¶
func (ds *DualShock4) Start()
func (*DualShock4) Stop ¶
func (ds *DualShock4) Stop()
type Gamepad ¶
type Gamepad interface { Projection() *GamepadProjection Start() Stop() EventChannel() *GamepadEventChannel }
type GamepadEvent ¶
type GamepadEvent struct { Name GamepadEventType // cross, gyroscope Action GamepadEventAction // press, release, swipe, move, update Data interface{} }
func NewGamepadEvent ¶
func NewGamepadEvent(name GamepadEventType, action GamepadEventAction, data interface{}) *GamepadEvent
NewEvent returns a new Event and its associated data.
func (GamepadEvent) IsDPad ¶
func (ge GamepadEvent) IsDPad() bool
type GamepadEventAction ¶
type GamepadEventAction int
const ( Press GamepadEventAction = iota Release Move Swipe Update )
type GamepadEventChannel ¶
type GamepadEventChannel chan *GamepadEvent
type GamepadEventType ¶
type GamepadEventType string
const ( EventTypeCross GamepadEventType = "Cross" EventTypeCircle GamepadEventType = "Circle" EventTypeSquare GamepadEventType = "Square" EventTypeTriangle GamepadEventType = "Triangle" EventTypeL1 GamepadEventType = "L1" EventTypeL2 GamepadEventType = "L2" EventTypeL3 GamepadEventType = "L3" EventTypeR1 GamepadEventType = "R1" EventTypeR2 GamepadEventType = "R2" EventTypeR3 GamepadEventType = "R3" EventTypeDPadUp GamepadEventType = dPadPrefix + "Up" EventTypeDPadDown GamepadEventType = dPadPrefix + "Down" EventTypeDPadLeft GamepadEventType = dPadPrefix + "Left" EventTypeDPadRight GamepadEventType = dPadPrefix + "Right" EventTypeOptions GamepadEventType = "Options" EventTypePs GamepadEventType = "Ps" EventTypeLeftStick GamepadEventType = "LeftStick" EventTypeRightStick GamepadEventType = "RightStick" EventTypeTouchpad GamepadEventType = "Touchpad" EventTypeAccelerometer GamepadEventType = "Accelerometer" EventTypeGyroscope GamepadEventType = "Gyroscope" EventTypeBattery GamepadEventType = "Battery" )
type GamepadProjection ¶
type GamepadProjection struct { Cross bool Circle bool Square bool Triangle bool L1 bool L2 byte L3 bool R1 bool R2 byte R3 bool DPadUp bool DPadDown bool DPadLeft bool DPadRight bool Options bool Ps bool LeftStick Stick RightStick Stick Touchpad Touchpad Accelerometer Accelerometer Gyroscope Gyroscope Battery Battery // contains filtered or unexported fields }
func NewGamepadProjection ¶
func NewGamepadProjection() *GamepadProjection
func (*GamepadProjection) DPadDirection ¶
func (gp *GamepadProjection) DPadDirection() *float64
type Keyboard ¶
type Keyboard interface { Projection() *KeyboardProjection Start() Stop() EventChannel() *KeyboardEventChannel }
type KeyboardEvent ¶
type KeyboardEvent struct { Name KeyboardEventType // char, symbol Action KeyboardEventAction // press, hold, release Data interface{} }
func NewKeyboardEvent ¶
func NewKeyboardEvent(name KeyboardEventType, action KeyboardEventAction, data interface{}) *KeyboardEvent
type KeyboardEventAction ¶
type KeyboardEventAction int
const ( PressKey KeyboardEventAction = iota HoldKey ReleaseKey )
type KeyboardEventChannel ¶
type KeyboardEventChannel chan *KeyboardEvent
type KeyboardEventType ¶
type KeyboardEventType string
const ( KeyEventTypeChar KeyboardEventType = "char" KeyEventTypeSymbol KeyboardEventType = "symbol" )
type KeyboardHard ¶
type KeyboardHard struct { KeyboardChannel KeyboardEventChannel // contains filtered or unexported fields }
func NewKeyboardHard ¶
func NewKeyboardHard(keyboardChannel *KeyboardEventChannel) *KeyboardHard
func (*KeyboardHard) EventChannel ¶
func (kbh *KeyboardHard) EventChannel() *KeyboardEventChannel
func (*KeyboardHard) Projection ¶
func (kbh *KeyboardHard) Projection() *KeyboardProjection
func (*KeyboardHard) Start ¶
func (kbh *KeyboardHard) Start()
func (*KeyboardHard) Stop ¶
func (kbh *KeyboardHard) Stop()
type KeyboardProjection ¶
type KeyboardProjection struct { }
func NewKeyboardProjection ¶
func NewKeyboardProjection() *KeyboardProjection
Click to show internal directories.
Click to hide internal directories.