ebiteninput

package
v0.0.0-...-94fff03 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 5 Imported by: 1 module, 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 ebiteninput is the Ebiten input.Source: it reads keyboard, mouse, gamepads and touches through ebiten and inpututil into an input.Frame once per tick. It is the only part of the input system that imports Ebiten. game.Engine creates one; wire it by hand with input.NewRouter(ebiteninput.New(size), opts).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceOf

func DeviceOf(id ebiten.GamepadID) input.DeviceID

DeviceOf returns the input.DeviceID the source uses for an Ebiten pad.

func LoadGamepadMappings

func LoadGamepadMappings(db string) error

LoadGamepadMappings adds SDL controller mappings (the text of a gamecontrollerdb.txt) so more pads get the standard layout and pad: controls instead of padraw:. It wraps ebiten.UpdateStandardGamepadLayoutMappings.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source reads Ebiten's input. Create it with New; call its methods only from Ebiten's Update (the Router does). Polling allocates nothing in steady state: every list comes from an Append* call into a reused slice.

func New

func New(size func() (w, h int)) *Source

New returns a source. size reports the logical screen size (the values Layout returned), which touch regions are relative to; nil reports 0x0.

func (*Source) KeyName

func (s *Source) KeyName(k input.Key) string

KeyName implements input.Source with ebiten.KeyName: the key's label on the current keyboard layout, where the platform reports it.

func (*Source) Poll

func (s *Source) Poll(f *input.Frame, ch *input.DeviceChanges)

Poll implements input.Source.

func (*Source) Vibrate

func (s *Source) Vibrate(id input.DeviceID, strong, weak float32, d time.Duration)

Vibrate implements input.Source with ebiten.VibrateGamepad.

Jump to

Keyboard shortcuts

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