Documentation ¶
Overview ¶
Package fake implements a fake input controller.
Index ¶
- func NewInputController(ctx context.Context, _ registry.Dependencies, config config.Component, ...) (interface{}, error)
- type Config
- type InputController
- func (c *InputController) GetControls(ctx context.Context) ([]input.Control, error)
- func (c *InputController) GetEvents(ctx context.Context) (map[input.Control]input.Event, error)
- func (c *InputController) RegisterControlCallback(ctx context.Context, control input.Control, triggers []input.EventType, ...) error
- func (c *InputController) TriggerEvent(ctx context.Context, event input.Event) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config can list input structs (with their states).
type InputController ¶
An InputController fakes an input.Controller.
func (*InputController) GetControls ¶
GetControls lists the inputs of the gamepad.
func (*InputController) GetEvents ¶
GetEvents returns the last input.Event (the current state) of each control.
func (*InputController) RegisterControlCallback ¶
func (c *InputController) RegisterControlCallback( ctx context.Context, control input.Control, triggers []input.EventType, ctrlFunc input.ControlFunction, ) error
RegisterControlCallback registers a callback function to be executed on the specified trigger Event.
func (*InputController) TriggerEvent ¶
TriggerEvent allows directly sending an Event (such as a button press) from external code.
Click to show internal directories.
Click to hide internal directories.