inpututil

package
v2.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 1,130

Documentation

Overview

Package inpututil provides utility functions of input like keyboard or mouse.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendJustConnectedGamepadIDs added in v2.2.0

func AppendJustConnectedGamepadIDs(gamepadIDs []ebiten.GamepadID) []ebiten.GamepadID

AppendJustConnectedGamepadIDs appends gamepad IDs that are connected just in the current tick to gamepadIDs, and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustConnectedGamepadIDs must be called in a game's Update, not Draw.

AppendJustConnectedGamepadIDs is concurrent safe.

func AppendJustPressedGamepadButtons added in v2.5.0

func AppendJustPressedGamepadButtons(id ebiten.GamepadID, buttons []ebiten.GamepadButton) []ebiten.GamepadButton

AppendJustPressedGamepadButtons append just pressed gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustPressedGamepadButtons must be called in a game's Update, not Draw.

AppendJustPressedGamepadButtons is concurrent safe.

func AppendJustPressedKeys added in v2.5.0

func AppendJustPressedKeys(keys []ebiten.Key) []ebiten.Key

AppendJustPressedKeys append just pressed keyboard keys to keys and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustPressedKeys must be called in a game's Update, not Draw.

AppendJustPressedKeys is concurrent safe.

func AppendJustPressedStandardGamepadButtons added in v2.5.0

func AppendJustPressedStandardGamepadButtons(id ebiten.GamepadID, buttons []ebiten.StandardGamepadButton) []ebiten.StandardGamepadButton

AppendJustPressedStandardGamepadButtons append just pressed standard gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustPressedStandardGamepadButtons must be called in a game's Update, not Draw.

AppendJustPressedStandardGamepadButtons is concurrent safe.

func AppendJustPressedTouchIDs added in v2.2.0

func AppendJustPressedTouchIDs(touchIDs []ebiten.TouchID) []ebiten.TouchID

AppendJustPressedTouchIDs append touch IDs that are created just in the current tick to touchIDs, and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustPressedTouchIDs must be called in a game's Update, not Draw.

AppendJustPressedTouchIDs is concurrent safe.

func AppendJustReleasedGamepadButtons added in v2.5.0

func AppendJustReleasedGamepadButtons(id ebiten.GamepadID, buttons []ebiten.GamepadButton) []ebiten.GamepadButton

AppendJustReleasedGamepadButtons append just released gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustReleasedGamepadButtons must be called in a game's Update, not Draw.

AppendJustReleasedGamepadButtons is concurrent safe.

func AppendJustReleasedKeys added in v2.5.0

func AppendJustReleasedKeys(keys []ebiten.Key) []ebiten.Key

AppendJustReleasedKeys append just released keyboard keys to keys and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustReleasedKeys must be called in a game's Update, not Draw.

AppendJustReleasedKeys is concurrent safe.

func AppendJustReleasedStandardGamepadButtons added in v2.5.0

func AppendJustReleasedStandardGamepadButtons(id ebiten.GamepadID, buttons []ebiten.StandardGamepadButton) []ebiten.StandardGamepadButton

AppendJustReleasedStandardGamepadButtons append just released standard gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustReleasedStandardGamepadButtons must be called in a game's Update, not Draw.

AppendJustReleasedStandardGamepadButtons is concurrent safe.

func AppendJustReleasedTouchIDs added in v2.4.0

func AppendJustReleasedTouchIDs(touchIDs []ebiten.TouchID) []ebiten.TouchID

AppendJustReleasedTouchIDs append touch IDs that are released just in the current tick to touchIDs, and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendJustReleasedTouchIDs must be called in a game's Update, not Draw.

AppendJustReleasedTouchIDs is concurrent safe.

func AppendPressedGamepadButtons added in v2.5.0

func AppendPressedGamepadButtons(id ebiten.GamepadID, buttons []ebiten.GamepadButton) []ebiten.GamepadButton

AppendPressedGamepadButtons append currently pressed gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendPressedGamepadButtons must be called in a game's Update, not Draw.

AppendPressedGamepadButtons is concurrent safe.

func AppendPressedKeys added in v2.2.0

func AppendPressedKeys(keys []ebiten.Key) []ebiten.Key

AppendPressedKeys append currently pressed keyboard keys to keys and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendPressedKeys must be called in a game's Update, not Draw.

AppendPressedKeys is concurrent safe.

func AppendPressedStandardGamepadButtons added in v2.5.0

func AppendPressedStandardGamepadButtons(id ebiten.GamepadID, buttons []ebiten.StandardGamepadButton) []ebiten.StandardGamepadButton

AppendPressedStandardGamepadButtons append currently pressed standard gamepad buttons to buttons and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.

AppendPressedStandardGamepadButtons must be called in a game's Update, not Draw.

AppendPressedStandardGamepadButtons is concurrent safe.

func GamepadButtonPressDuration

func GamepadButtonPressDuration(id ebiten.GamepadID, button ebiten.GamepadButton) int

GamepadButtonPressDuration returns how long the gamepad button of the gamepad id is pressed in ticks (Update).

GamepadButtonPressDuration must be called in a game's Update, not Draw.

GamepadButtonPressDuration is concurrent safe.

func IsGamepadButtonJustPressed

func IsGamepadButtonJustPressed(id ebiten.GamepadID, button ebiten.GamepadButton) bool

IsGamepadButtonJustPressed returns a boolean value indicating whether the given gamepad button of the gamepad id is pressed just in the current tick.

IsGamepadButtonJustPressed must be called in a game's Update, not Draw.

IsGamepadButtonJustPressed is concurrent safe.

func IsGamepadButtonJustReleased

func IsGamepadButtonJustReleased(id ebiten.GamepadID, button ebiten.GamepadButton) bool

IsGamepadButtonJustReleased returns a boolean value indicating whether the given gamepad button of the gamepad id is released just in the current tick.

IsGamepadButtonJustReleased must be called in a game's Update, not Draw.

IsGamepadButtonJustReleased is concurrent safe.

func IsGamepadJustDisconnected

func IsGamepadJustDisconnected(id ebiten.GamepadID) bool

IsGamepadJustDisconnected returns a boolean value indicating whether the gamepad of the given id is released just in the current tick.

IsGamepadJustDisconnected must be called in a game's Update, not Draw.

IsGamepadJustDisconnected is concurrent safe.

func IsKeyJustPressed

func IsKeyJustPressed(key ebiten.Key) bool

IsKeyJustPressed returns a boolean value indicating whether the given key is pressed just in the current tick.

IsKeyJustPressed must be called in a game's Update, not Draw.

IsKeyJustPressed is concurrent safe.

func IsKeyJustReleased

func IsKeyJustReleased(key ebiten.Key) bool

IsKeyJustReleased returns a boolean value indicating whether the given key is released just in the current tick.

IsKeyJustReleased must be called in a game's Update, not Draw.

IsKeyJustReleased is concurrent safe.

func IsMouseButtonJustPressed

func IsMouseButtonJustPressed(button ebiten.MouseButton) bool

IsMouseButtonJustPressed returns a boolean value indicating whether the given mouse button is pressed just in the current tick.

IsMouseButtonJustPressed must be called in a game's Update, not Draw.

IsMouseButtonJustPressed is concurrent safe.

func IsMouseButtonJustReleased

func IsMouseButtonJustReleased(button ebiten.MouseButton) bool

IsMouseButtonJustReleased returns a boolean value indicating whether the given mouse button is released just in the current tick.

IsMouseButtonJustReleased must be called in a game's Update, not Draw.

IsMouseButtonJustReleased is concurrent safe.

func IsStandardGamepadButtonJustPressed added in v2.2.0

func IsStandardGamepadButtonJustPressed(id ebiten.GamepadID, button ebiten.StandardGamepadButton) bool

IsStandardGamepadButtonJustPressed returns a boolean value indicating whether the given standard gamepad button of the gamepad id is pressed just in the current tick.

IsStandardGamepadButtonJustPressed must be called in a game's Update, not Draw.

IsStandardGamepadButtonJustPressed is concurrent safe.

func IsStandardGamepadButtonJustReleased added in v2.2.0

func IsStandardGamepadButtonJustReleased(id ebiten.GamepadID, button ebiten.StandardGamepadButton) bool

IsStandardGamepadButtonJustReleased returns a boolean value indicating whether the given standard gamepad button of the gamepad id is released just in the current tick.

IsStandardGamepadButtonJustReleased must be called in a game's Update, not Draw.

IsStandardGamepadButtonJustReleased is concurrent safe.

func IsTouchJustReleased

func IsTouchJustReleased(id ebiten.TouchID) bool

IsTouchJustReleased returns a boolean value indicating whether the given touch is released just in the current tick.

IsTouchJustReleased must be called in a game's Update, not Draw.

IsTouchJustReleased is concurrent safe.

func JustConnectedGamepadIDs deprecated

func JustConnectedGamepadIDs() []ebiten.GamepadID

JustConnectedGamepadIDs returns gamepad IDs that are connected just in the current tick.

JustConnectedGamepadIDs must be called in a game's Update, not Draw.

Deprecated: as of v2.2. Use AppendJustConnectedGamepadIDs instead.

func JustPressedTouchIDs deprecated

func JustPressedTouchIDs() []ebiten.TouchID

JustPressedTouchIDs returns touch IDs that are created just in the current tick.

JustPressedTouchIDs must be called in a game's Update, not Draw.

Deprecated: as of v2.2. Use AppendJustPressedTouchIDs instead.

func KeyPressDuration

func KeyPressDuration(key ebiten.Key) int

KeyPressDuration returns how long the key is pressed in ticks (Update).

KeyPressDuration must be called in a game's Update, not Draw.

KeyPressDuration is concurrent safe.

func MouseButtonPressDuration

func MouseButtonPressDuration(button ebiten.MouseButton) int

MouseButtonPressDuration returns how long the mouse button is pressed in ticks (Update).

MouseButtonPressDuration must be called in a game's Update, not Draw.

MouseButtonPressDuration is concurrent safe.

func PressedKeys deprecated added in v2.1.0

func PressedKeys() []ebiten.Key

PressedKeys returns a set of currently pressed keyboard keys.

PressedKeys must be called in a game's Update, not Draw.

Deprecated: as of v2.2. Use AppendPressedKeys instead.

func StandardGamepadButtonPressDuration added in v2.2.0

func StandardGamepadButtonPressDuration(id ebiten.GamepadID, button ebiten.StandardGamepadButton) int

StandardGamepadButtonPressDuration returns how long the standard gamepad button of the gamepad id is pressed in ticks (Update).

StandardGamepadButtonPressDuration must be called in a game's Update, not Draw.

StandardGamepadButtonPressDuration is concurrent safe.

func TouchPositionInPreviousTick added in v2.4.0

func TouchPositionInPreviousTick(id ebiten.TouchID) (int, int)

TouchPositionInPreviousTick returns the position in the previous tick. If the touch is a just-released touch, TouchPositionInPreviousTick returns the last position of the touch.

TouchPositionInPreviousTick must be called in a game's Update, not Draw.

TouchJustReleasedPosition is concurrent safe.

func TouchPressDuration

func TouchPressDuration(id ebiten.TouchID) int

TouchPressDuration returns how long the touch remains in ticks (Update).

TouchPressDuration must be called in a game's Update, not Draw.

TouchPressDuration is concurrent safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

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