Documentation
¶
Overview ¶
Package padstd helps the backends whose pads already report the standard layout (XInput on Windows, the standard mapping of a browser): such a pad is a PadInfo with Standard set, and its raw buttons and axes are the Button and Axis of gamepaddb in the order of the layout. A backend that polls fills a Snapshot each time and a Tracker turns the changes into PadEvents (SPEC §28.2). It is plain Go with no OS tag.
Flutter: no counterpart
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flip ¶
Flip turns an axis around: the vertical axes of XInput are positive upwards and those of the layout downwards.
Flutter: no counterpart
func Signed ¶
Signed scales a number from −1 to 1, as the browser gives a stick, to the range of an axis, clamping it.
Flutter: no counterpart
Types ¶
type Snapshot ¶
Snapshot is the state of a pad of the standard layout: which buttons are down, and the axes (the sticks from −32768 to 32767 with down and right positive, the triggers from 0 to 32767).
Flutter: no counterpart
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker turns the snapshots of one pad into the events of what changed.
Flutter: no counterpart
func NewTracker ¶
NewTracker makes the tracker of a pad that has just been connected: the state it starts from is everything up and every axis at rest.
Flutter: no counterpart
func (*Tracker) Update ¶
func (t *Tracker) Update(now time.Duration, s *Snapshot, out []platform.PadEvent) []platform.PadEvent
Update appends to out the events of what differs between s and the snapshot before it, buttons first and then axes, and remembers s. now is the time the state was read.
Flutter: no counterpart