pointer

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pointer reports pointer events that GUI toolkits built on GLFW do not pass on, starting with the trackpad pinch, cgo-free.

Threading: Watch must be called on the main thread, and fn runs there, in the middle of the host's event handling. Keep fn short; an Ebitengine app queues the event for its Update.

Implemented on macOS, through a local NSEvent monitor: events are seen and passed on unchanged, so the host still gets them. Elsewhere Watch returns ErrUnsupported.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = fmt.Errorf("pointer: not supported on this platform: %w", errors.ErrUnsupported)

Functions

func Watch

func Watch(fn func(Event)) (stop func(), err error)

Watch calls fn with every event of the kinds this package reports until stop is called. stop is safe to call more than once.

Types

type Event

type Event struct {
	Kind Kind
	// Magnification, for Magnify, is the change in scale this event adds:
	// 0.1 is ten percent larger, negative is smaller.
	Magnification float64
}

type Kind

type Kind int
const (
	// Magnify is a pinch on the trackpad.
	Magnify Kind = iota + 1
)

Jump to

Keyboard shortcuts

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