Documentation ¶
Overview ¶
Package inpututil provides utility functions of input like keyboard or mouse.
Index ¶
- func AppendJustConnectedGamepadIDs(gamepadIDs []ebiten.GamepadID) []ebiten.GamepadID
- func AppendJustPressedTouchIDs(touchIDs []ebiten.TouchID) []ebiten.TouchID
- func AppendPressedKeys(keys []ebiten.Key) []ebiten.Key
- func GamepadButtonPressDuration(id ebiten.GamepadID, button ebiten.GamepadButton) int
- func IsGamepadButtonJustPressed(id ebiten.GamepadID, button ebiten.GamepadButton) bool
- func IsGamepadButtonJustReleased(id ebiten.GamepadID, button ebiten.GamepadButton) bool
- func IsGamepadJustDisconnected(id ebiten.GamepadID) bool
- func IsKeyJustPressed(key ebiten.Key) bool
- func IsKeyJustReleased(key ebiten.Key) bool
- func IsMouseButtonJustPressed(button ebiten.MouseButton) bool
- func IsMouseButtonJustReleased(button ebiten.MouseButton) bool
- func IsStandardGamepadButtonJustPressed(id ebiten.GamepadID, button ebiten.StandardGamepadButton) bool
- func IsStandardGamepadButtonJustReleased(id ebiten.GamepadID, button ebiten.StandardGamepadButton) bool
- func IsTouchJustReleased(id ebiten.TouchID) bool
- func JustConnectedGamepadIDs() []ebiten.GamepadIDdeprecated
- func JustPressedTouchIDs() []ebiten.TouchIDdeprecated
- func KeyPressDuration(key ebiten.Key) int
- func MouseButtonPressDuration(button ebiten.MouseButton) int
- func PressedKeys() []ebiten.Keydeprecated
- func StandardGamepadButtonPressDuration(id ebiten.GamepadID, button ebiten.StandardGamepadButton) int
- func TouchPressDuration(id ebiten.TouchID) int
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 frame to gamepadIDs, and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.
AppendJustConnectedGamepadIDs 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 frame to touchIDs, and returns the extended buffer. Giving a slice that already has enough capacity works efficiently.
AppendJustPressedTouchIDs 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 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 frames.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
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 frame.
IsTouchJustReleased is concurrent safe.
func JustConnectedGamepadIDs
deprecated
func JustConnectedGamepadIDs() []ebiten.GamepadID
JustConnectedGamepadIDs returns gamepad IDs that are connected just in the current frame.
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 frame.
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 frames.
KeyPressDuration is concurrent safe.
func MouseButtonPressDuration ¶
func MouseButtonPressDuration(button ebiten.MouseButton) int
MouseButtonPressDuration returns how long the mouse button is pressed in frames.
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.
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 frames.
StandardGamepadButtonPressDuration is concurrent safe.
func TouchPressDuration ¶
func TouchPressDuration(id ebiten.TouchID) int
TouchPressDuration returns how long the touch remains in frames.
TouchPressDuration is concurrent safe.
Types ¶
This section is empty.