Documentation ¶
Index ¶
- Constants
- func AxisValue(id string, axis StandardAxis, state GamepadState) float64
- func ButtonValue(id string, button StandardButton, state GamepadState) float64
- func HasStandardAxis(id string, axis StandardAxis) bool
- func HasStandardButton(id string, button StandardButton) bool
- func HasStandardLayoutMapping(id string) bool
- func IsButtonPressed(id string, button StandardButton, state GamepadState) bool
- func Name(id string) string
- func Update(mappingData []byte) error
- type GamepadState
- type StandardAxis
- type StandardButton
Constants ¶
View Source
const ( HatUp = 1 HatRight = 2 HatDown = 4 HatLeft = 8 )
View Source
const ( SDLControllerButtonA = 0 SDLControllerButtonB = 1 SDLControllerButtonX = 2 SDLControllerButtonY = 3 SDLControllerButtonBack = 4 SDLControllerButtonGuide = 5 SDLControllerButtonStart = 6 SDLControllerButtonLeftStick = 7 SDLControllerButtonRightStick = 8 SDLControllerButtonLeftShoulder = 9 SDLControllerButtonRightShoulder = 10 SDLControllerButtonDpadUp = 11 SDLControllerButtonDpadDown = 12 SDLControllerButtonDpadLeft = 13 SDLControllerButtonDpadRight = 14 SDLControllerButtonMisc1 = 15 SDLControllerButtonPaddle1 = 16 SDLControllerButtonPaddle2 = 17 SDLControllerButtonPaddle3 = 18 SDLControllerButtonPaddle4 = 19 SDLControllerButtonTouchpad = 20 SDLControllerButtonMax = SDLControllerButtonTouchpad // This is different from the original SDL_CONTROLLER_BUTTON_MAX. )
View Source
const ( SDLControllerAxisLeftX = 0 SDLControllerAxisLeftY = 1 SDLControllerAxisRightX = 2 SDLControllerAxisRightY = 3 SDLControllerAxisTriggerLeft = 4 SDLControllerAxisTriggerRight = 5 )
Variables ¶
This section is empty.
Functions ¶
func AxisValue ¶
func AxisValue(id string, axis StandardAxis, state GamepadState) float64
func ButtonValue ¶
func ButtonValue(id string, button StandardButton, state GamepadState) float64
func HasStandardAxis ¶ added in v2.4.0
func HasStandardAxis(id string, axis StandardAxis) bool
func HasStandardButton ¶ added in v2.4.0
func HasStandardButton(id string, button StandardButton) bool
func IsButtonPressed ¶
func IsButtonPressed(id string, button StandardButton, state GamepadState) bool
Types ¶
type GamepadState ¶
type StandardAxis ¶ added in v2.3.0
type StandardAxis int
const ( StandardAxisLeftStickHorizontal StandardAxis = iota StandardAxisLeftStickVertical StandardAxisRightStickHorizontal StandardAxisRightStickVertical StandardAxisMax = StandardAxisRightStickVertical )
type StandardButton ¶ added in v2.3.0
type StandardButton int
const ( StandardButtonRightBottom StandardButton = iota StandardButtonRightRight StandardButtonRightLeft StandardButtonRightTop StandardButtonFrontTopLeft StandardButtonFrontTopRight StandardButtonFrontBottomLeft StandardButtonFrontBottomRight StandardButtonCenterLeft StandardButtonCenterRight StandardButtonLeftStick StandardButtonRightStick StandardButtonLeftTop StandardButtonLeftBottom StandardButtonLeftLeft StandardButtonLeftRight StandardButtonCenterCenter StandardButtonMax = StandardButtonCenterCenter )
Click to show internal directories.
Click to hide internal directories.