package hid
Constants
ControllerButtonUp
iota
ControllerButtonDown
ControllerButtonLeft
ControllerButtonRight
ControllerButtonStart
ControllerButtonSelect
ControllerButtonLeftStick
ControllerButtonRightStick
ControllerButtonLeftBumper
ControllerButtonRightBumper
ControllerButtonEx1
TODO
Name
this
correctly
ControllerButtonEx2
TODO
Name
this
correctly
ControllerButtonA
ControllerButtonB
ControllerButtonX
ControllerButtonY
ControllerButtonMax
ControllerAxisLeftVertical
iota
ControllerAxisLeftHorizontal
ControllerAxisRightVertical
ControllerAxisRightHorizontal
ControllerAxisLeftTrigger
ControllerAxisRightTrigger
ControllerAxisMax
MouseButtonLeft
iota
MouseButtonMiddle
MouseButtonRight
MouseButtonX1
MouseButtonX2
MouseButtonLast
MouseInvalid
-1
MouseRelease
iota
MousePress
MouseRepeat
MouseButtonStateInvalid
-1
AMotionEventActionIdle
99
AMotionEventActionHeld
100
AMotionEventActionHoverEnter
1 + iota
AMotionEventActionHoverMove
AMotionEventActionHoverExit
AMotionEventActionHover
AMotionEventActionDown
AMotionEventActionMove
AMotionEventActionUp
ControllerMaxDevices
8
MaxTouchPointersAvailable
10
Types
Controller
struct
NewController
NewController creates a new controller. This is called automatically by the system and should not be called by the end-developer
Controller.Available
Available returns true if the controller is available. This is called automatically by the system and should not be called by the end-developer
Controller.Axis
Axis returns the axis value for the given controller and stick
Controller.Connected
Connected returns true if the controller is connected. This is called automatically by the system and should not be called by the end-developer
Controller.Disconnected
Disconnected returns true if the controller is disconnected. This is called automatically by the system and should not be called by the end-developer
Controller.EndUpdate
EndUpdate is called at the end of the frame. It updates the state of each controller for the next frame. This is called automatically by the system and should not be called by the end-developer
Controller.IsButtonDown
IsButtonDown returns true if the button is down
Controller.IsButtonHeld
IsButtonHeld returns true if the button is held
Controller.IsButtonUp
IsButtonUp returns true if the button is up
Controller.Reset
Reset will completely wipe the state of all controllers
Controller.SetAxis
SetAxis sets the axis on the given controller. This is called automatically by the system and should not be called by the end-developer
Controller.SetButtonDown
SetButtonDown sets the button down on the given controller. This is called automatically by the system and should not be called by the end-developer
Controller.SetButtonUp
SetButtonUp sets the button up on the given controller. This is called automatically by the system and should not be called by the end-developer
ControllerDevice
struct
Cursor
struct
NewCursor
Cursor.DragData
Cursor.HasDragData
Cursor.Held
Cursor.Moved
Cursor.Poll
Cursor.Position
Cursor.Pressed
Cursor.Released
Cursor.ScreenPosition
Cursor.UIPosition
DragData
interface
KeyState
const ( KeyStateIdle KeyState = iota KeyStateDown KeyStateHeld KeyStateUp KeyStatePressedAndReleased )
Keyboard
struct
NewKeyboard
Keyboard.AddKeyCallback
Keyboard.EndUpdate
Keyboard.HasAlt
Keyboard.HasCtrl
Keyboard.HasShift
Keyboard.KeyDown
Keyboard.KeyHeld
Keyboard.KeyToRune
Keyboard.KeyUp
Keyboard.RemoveKeyCallback
Keyboard.Reset
Keyboard.SetKeyDown
Keyboard.SetKeyDownUp
Keyboard.SetKeyUp
KeyboardKey
const ( KeyBoardKeyInvalid KeyboardKey = -1 + iota KeyboardKeyLeftAlt KeyboardKeyRightAlt KeyboardKeyLeftCtrl KeyboardKeyRightCtrl KeyboardKeyLeftShift KeyboardKeyRightShift KeyboardKeyA KeyboardKeyB KeyboardKeyC KeyboardKeyD KeyboardKeyE KeyboardKeyF KeyboardKeyG KeyboardKeyH KeyboardKeyI KeyboardKeyJ KeyboardKeyK KeyboardKeyL KeyboardKeyM KeyboardKeyN KeyboardKeyO KeyboardKeyP KeyboardKeyQ KeyboardKeyR KeyboardKeyS KeyboardKeyT KeyboardKeyU KeyboardKeyV KeyboardKeyW KeyboardKeyX KeyboardKeyY KeyboardKeyZ KeyboardKeyLeft KeyboardKeyUp KeyboardKeyRight KeyboardKeyDown KeyboardKeyEscape KeyboardKeyTab KeyboardKeySpace KeyboardKeyBackspace KeyboardKeyBackQuote KeyboardKeyDelete KeyboardKeyReturn KeyboardKeyEnter KeyboardKeyComma KeyboardKeyPeriod KeyboardKeyBackSlash KeyboardKeyForwardSlash KeyboardKeyOpenBracket KeyboardKeyCloseBracket KeyboardKeySemicolon KeyboardKeyQuote KeyboardKeyEqual KeyboardKeyMinus KeyboardKey0 KeyboardKey1 KeyboardKey2 KeyboardKey3 KeyboardKey4 KeyboardKey5 KeyboardKey6 KeyboardKey7 KeyboardKey8 KeyboardKey9 KeyboardNumKey0 KeyboardNumKey1 KeyboardNumKey2 KeyboardNumKey3 KeyboardNumKey4 KeyboardNumKey5 KeyboardNumKey6 KeyboardNumKey7 KeyboardNumKey8 KeyboardNumKey9 KeyboardKeyF1 KeyboardKeyF2 KeyboardKeyF3 KeyboardKeyF4 KeyboardKeyF5 KeyboardKeyF6 KeyboardKeyF7 KeyboardKeyF8 KeyboardKeyF9 KeyboardKeyF10 KeyboardKeyF11 KeyboardKeyF12 KeyboardKeyCapsLock KeyboardKeyScrollLock KeyboardKeyNumLock KeyboardKeyPrintScreen KeyboardKeyPause KeyboardKeyInsert KeyboardKeyHome KeyboardKeyPageUp KeyboardKeyPageDown KeyboardKeyEnd KeyboardKeyMaximum )
ToKeyboardKey
Mouse
struct
type Mouse struct {
X, Y float32
SX, SY float32
CX, CY float32
ScrollX, ScrollY float32
OnDragStop events.Event
// Has unexported fields.
}
NewMouse
Mouse.ButtonChanged
Mouse.ButtonState
Mouse.CenteredPosition
Mouse.DragData
Mouse.EndUpdate
Mouse.Held
Mouse.Moved
Mouse.Position
Mouse.Pressed
Mouse.Released
Mouse.Reset
Mouse.ScreenPosition
Mouse.Scroll
Mouse.Scrolled
Mouse.SetDown
Mouse.SetDragData
Mouse.SetPosition
Mouse.SetScroll
Mouse.SetUp
Stylus
struct
type Stylus struct {
X float32
Y float32
IY float32
Pressure float32
Distance float32
// Has unexported fields.
}
NewStylus
Stylus.ActionState
Stylus.EndUpdate
Stylus.Held
Stylus.IsActive
Stylus.Moved
Stylus.Pressed
Stylus.Released
Stylus.Reset
Stylus.Set
Stylus.SetActionState
Stylus.SetDistance
StylusActionState
const ( StylusActionNone StylusActionState = AMotionEventActionIdle StylusActionHoverEnter StylusActionState = AMotionEventActionHoverEnter StylusActionHoverMove StylusActionState = AMotionEventActionHoverMove StylusActionHoverExit StylusActionState = AMotionEventActionHoverExit StylusActionDown StylusActionState = AMotionEventActionDown StylusActionMove StylusActionState = AMotionEventActionMove StylusActionUp StylusActionState = AMotionEventActionUp StylusActionHeld StylusActionState = AMotionEventActionHeld StylusActionHover StylusActionState = AMotionEventActionHover )
Touch
struct
NewTouch
Touch.Cancel
Touch.Cancelled
Touch.EndUpdate
Touch.Held
Touch.Moved
Touch.Pointer
Touch.Pressed
Touch.Released
Touch.Reset
Touch.SetDown
Touch.SetMoved
Touch.SetPressure
Touch.SetUp
TouchAction
const ( TouchActionNone TouchAction = -1 TouchActionDown TouchAction = internalTouchActionDown TouchActionUp TouchAction = internalTouchActionUp TouchActionMove TouchAction = internalTouchActionMove TouchActionCancel TouchAction = -2 TouchActionHeld TouchAction = -3 )
TouchPointer
struct