Documentation
¶
Overview ¶
Package input provides a wrapper to handle user input events (keyboard and mouse for now).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { Mouse MouseEvent // contains filtered or unexported fields }
Manager hold data of events
func (*Manager) Button ¶
func (i *Manager) Button() sdl.KeyboardEvent
Button returns the first button pressed. Useful to use in multiple systems
func (*Manager) HandleEvents ¶
HandleEvents handle the events such as key pressed and mouse movements.
type MouseEvent ¶
type MouseEvent struct { Pos *sdl.Point Button uint8 // BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_X1, BUTTON_X2 State uint8 // PRESSED, RELEASE }
MouseEvent has the position and button pressed by the mouse
func (*MouseEvent) ClearMouseEvent ¶
func (m *MouseEvent) ClearMouseEvent()
ClearMouseEvent sets the id of the button to 0 which no mouse button is assigned to
Click to show internal directories.
Click to hide internal directories.