mouse

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

README

./platform.png

For engine, please, see engine repository

Documentation

Index

Constants

View Source
const (
	KPlatformWebBrowser platformCursorPointer = iota
)

Variables

This section is empty.

Functions

func AddFunctionPointer

func AddFunctionPointer(id string, collisionFunction PointerCollisionFunction, positiveEventFunction PointerEventFunction)

func AddFunctionPointerList

func AddFunctionPointerList(id string, collisionFunction []PointerCollisionFunction, positiveEventFunction []PointerEventFunction)

func DeleteFunctionPointer

func DeleteFunctionPointer(id string)

func ManagerClick

func ManagerClick(x, y float64)

func ManagerContextMenu

func ManagerContextMenu(x, y float64)

func ManagerDoubleClick

func ManagerDoubleClick(x, y float64)

func ManagerMouseDown

func ManagerMouseDown(x, y float64)

func ManagerMouseEnter

func ManagerMouseEnter(x, y float64)

func ManagerMouseMove

func ManagerMouseMove(x, y float64)

func ManagerMouseOut

func ManagerMouseOut(x, y float64)

func ManagerMouseUp

func ManagerMouseUp(x, y float64)

func RemoveFunctionPointer

func RemoveFunctionPointer(id string)

Types

type Coordinate

type Coordinate struct {
	X       int
	Y       int
	HasInit bool
}

func (*Coordinate) GetEventCoordinate

func (el *Coordinate) GetEventCoordinate() (int, int)

func (*Coordinate) SetEventCoordinate

func (el *Coordinate) SetEventCoordinate(x, y int)

type CursorPointer

type CursorPointer struct {
	Id   string
	Path string
	Img  string
}

type CursorType

type CursorType int
const (
	KCursorDefault CursorType = iota
	KCursorArrowBottomLeft
	KCursorArrowBottomRight
	KCursorArrowDown
	KCursorArrowCollapse
	KCursorArrowCollapseAll
	KCursorArrowCollapseDown
	KCursorArrowCollapseHorizontal
	KCursorArrowCollapseLeft
	KCursorArrowCollapseRight
	KCursorArrowCollapseUp
	KCursorArrowCollapseVertical
	KCursorArrowExpand
	KCursorArrowExpandAll
	KCursorArrowExpandDown
	KCursorArrowExpandHorizontal
	KCursorArrowExpandLeft
	KCursorArrowExpandRight
	KCursorArrowExpandUp
	KCursorArrowExpandVertical
	KCursorArrowHorizontalLock
	KCursorArrowLeft
	KCursorArrowLeftRight
	KCursorArrowRight
	KCursorArrowTopLeft
	KCursorArrowTopLeftBottomRight
	KCursorArrowTopRight
	KCursorArrowTopRightBottomLeft
	KCursorArrowUp
	KCursorArrowUpDown
)

func (CursorType) String

func (el CursorType) String() string

type EventId

type EventId struct {
	Id   string
	Over bool
	X    float64
	Y    float64
}

type EventMouse

type EventMouse int
const (
	// en: The event occurs when the user clicks on an element
	KClick EventMouse = iota

	// en: The event occurs when the user right-clicks on an element to open a context
	// menu
	KContextMenu

	// en: The event occurs when the user double-clicks on an element
	KDoubleClick

	// en: The event occurs when the user presses a mouse button over an element
	KMouseDown

	// en: The event occurs when the pointer is moved onto an element
	KMouseEnter

	// en: The event occurs when the pointer is moved out of an element
	KMouseLeave

	// en: The event occurs when the pointer is moving while it is over an element
	KMouseMove

	// en: The event occurs when the pointer is moved onto an element, or onto one of
	// its children
	KMouseOver

	// en: The event occurs when a user moves the mouse pointer out of an element, or
	// out of one of its children
	KMouseOut

	// en: The event occurs when a user releases a mouse button over an element
	KMouseUp
)

func (EventMouse) String

func (el EventMouse) String() string

func (EventMouse) StringToType

func (el EventMouse) StringToType(value string) EventMouse

type PointerCollisionFunction

type PointerCollisionFunction func(x, y float64) bool

type PointerComplexFunction

type PointerComplexFunction func(ritFunction PointerCollisionFunction, positiveEventFunction PointerEventFunction)

type PointerComplexFunctionList

type PointerComplexFunctionList []PointerComplexFunction

type PointerEventFunction

type PointerEventFunction func(x, y float64, collision bool, event EventMouse)

type SendToChannel

type SendToChannel struct {
	List []chan Coordinate
}
var Click SendToChannel
var DoubleClick SendToChannel
var Down SendToChannel
var Move SendToChannel
var Up SendToChannel

func (*SendToChannel) Add

func (el *SendToChannel) Add(value chan Coordinate) int

func (*SendToChannel) Init

func (el *SendToChannel) Init()

func (*SendToChannel) Remove

func (el *SendToChannel) Remove(key int) error

type SetCursorFunc

type SetCursorFunc func(element interface{}, cursor interface{})

Jump to

Keyboard shortcuts

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