procon

package
v0.0.0-...-1d32e87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateCrashed      = "crashed"
	StateConnected    = "connected"
	StateDisconnected = "disconnected"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rpc.Client
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) Disconnect

func (c *Client) Disconnect() error

func (*Client) Input

func (c *Client) Input(in Input) error

func (*Client) Start

func (c *Client) Start(ctx context.Context, script string) error

func (*Client) State

func (c *Client) State() (*State, error)

func (*Client) Stop

func (c *Client) Stop() error

type Input

type Input struct {
	LStick    LStick `json:"L_STICK"`
	RStick    RStick `json:"R_STICK"`
	DpadUp    bool   `json:"DPAD_UP"`
	DpadLeft  bool   `json:"DPAD_LEFT"`
	DpadRight bool   `json:"DPAD_RIGHT"`
	DpadDown  bool   `json:"DPAD_DOWN"`
	L         bool   `json:"L"`
	Zl        bool   `json:"ZL"`
	R         bool   `json:"R"`
	Zr        bool   `json:"ZR"`
	JclSr     bool   `json:"JCL_SR"`
	JclSl     bool   `json:"JCL_SL"`
	JcrSr     bool   `json:"JCR_SR"`
	JcrSl     bool   `json:"JCR_SL"`
	Plus      bool   `json:"PLUS"`
	Minus     bool   `json:"MINUS"`
	Home      bool   `json:"HOME"`
	Capture   bool   `json:"CAPTURE"`
	Y         bool   `json:"Y"`
	X         bool   `json:"X"`
	B         bool   `json:"B"`
	A         bool   `json:"A"`
}

type LStick

type LStick struct {
	Pressed bool `json:"PRESSED"`
	XValue  int  `json:"X_VALUE"`
	YValue  int  `json:"Y_VALUE"`
	LsUp    bool `json:"LS_UP"`
	LsLeft  bool `json:"LS_LEFT"`
	LsRight bool `json:"LS_RIGHT"`
	LsDown  bool `json:"LS_DOWN"`
}

type RStick

type RStick struct {
	Pressed bool `json:"PRESSED"`
	XValue  int  `json:"X_VALUE"`
	YValue  int  `json:"Y_VALUE"`
	RsUp    bool `json:"RS_UP"`
	RsLeft  bool `json:"RS_LEFT"`
	RsRight bool `json:"RS_RIGHT"`
	RsDown  bool `json:"RS_DOWN"`
}

type State

type State struct {
	State  string  `json:"state"`
	Errors *string `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL