mouse

package
v0.0.0-...-124f97e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Press   Action = Action(glfw.Press)
	Release        = Action(glfw.Release)
	Move           = Action(4)
	Scroll         = Action(5)
	Enter          = Action(6)
	Leave          = Action(7)
)

Variables

This section is empty.

Functions

func Hide

func Hide()

func Lock

func Lock()

func Show

func Show()

Types

type Action

type Action int

func (Action) String

func (a Action) String() string

type Button

type Button glfw.MouseButton

func (Button) String

func (b Button) String() string

type Callback

type Callback func(Event)

type Event

type Event interface {
	Action() Action
	Button() Button
	Position() vec2.T
	Delta() vec2.T
	Scroll() vec2.T
	Modifier() keys.Modifier
	Project(vec2.T) Event
	Locked() bool

	Handled() bool
	Consume()
}

func NewButtonEvent

func NewButtonEvent(button Button, action Action, pos vec2.T, mod keys.Modifier, locked bool) Event

func NewMouseEnterEvent

func NewMouseEnterEvent() Event

func NewMouseLeaveEvent

func NewMouseLeaveEvent() Event

func NopEvent

func NopEvent() Event

type Handler

type Handler interface {
	MouseEvent(Event)
}

type MouseWrapper

type MouseWrapper interface {
	Button(w *glfw.Window, button glfw.MouseButton, action glfw.Action, mod glfw.ModifierKey)
	Move(w *glfw.Window, x, y float64)
	Scroll(w *glfw.Window, x, y float64)
}

func NewWrapper

func NewWrapper(handler Handler) MouseWrapper

type State

type State interface {
	Handler

	Down(Button) bool
	Up(Button) bool
}

func NewState

func NewState() State

Jump to

Keyboard shortcuts

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