input

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

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

Lock represents a client input lock that can be applied to a player to disable specific inputs such as camera rotation, movement, jumping, sneaking or mounting/dismounting entities.

func All

func All() []Lock

All returns all the input locks that are available to be applied to a player.

func Camera

func Camera() Lock

Camera is the lock that disables all camera movement.

func Dismount

func Dismount() Lock

Dismount is the lock that prevents the player from dismounting entities.

func Jump

func Jump() Lock

Jump is the lock that disables the player from jumping.

func LateralMovement

func LateralMovement() Lock

LateralMovement is the lock that disables all player movement excluding jumping and sneaking.

func Mount

func Mount() Lock

Mount is the lock that prevents the player from mounting entities.

func MoveBackward

func MoveBackward() Lock

MoveBackward is the lock that disables backward movement.

func MoveForward

func MoveForward() Lock

MoveForward is the lock that disables forward movement.

func MoveLeft

func MoveLeft() Lock

MoveLeft is the lock that disables left strafe movement.

func MoveRight

func MoveRight() Lock

MoveRight is the lock that disables right strafe movement.

func Movement

func Movement() Lock

Movement is the lock that disables all player movement, including jumping and sneaking.

func Sneak

func Sneak() Lock

Sneak is the lock that disables the player from sneaking.

func (Lock) Uint32

func (l Lock) Uint32() uint32

Uint32 returns the lock as a uint32.

type Restricter

type Restricter interface {
	// LockInput applies an input lock to the player, disabling the specified input.
	LockInput(l Lock)
	// UnlockInput removes an input lock from the player, re-enabling the specified input.
	UnlockInput(l Lock)
	// ClearInputLocks removes all input locks from the player, re-enabling all inputs.
	ClearInputLocks()
	// InputLocked checks if a specific input lock is currently applied to the player.
	InputLocked(l Lock) bool
}

Restricter represents an interface that can manage input locks for a player.

Jump to

Keyboard shortcuts

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