InputMap

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Manages all InputEventAction which can be created/modified from the project settings menu Project > Project Settings > Input Map or in code with AddAction and ActionAddEvent. See Node.Input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionAddEvent

func ActionAddEvent(action string, event InputEvent.Instance)

Adds an InputEvent to an action. This InputEvent will trigger the action.

func ActionEraseEvent

func ActionEraseEvent(action string, event InputEvent.Instance)

Removes an InputEvent from an action.

func ActionEraseEvents

func ActionEraseEvents(action string)

Removes all events from an action.

func ActionGetDeadzone

func ActionGetDeadzone(action string) Float.X

Returns a deadzone value for the action.

func ActionGetEvents

func ActionGetEvents(action string) []InputEvent.Instance

Returns an array of InputEvents associated with a given action.

Note: When used in the editor (e.g. a tool script or EditorPlugin), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the input/* settings from ProjectSettings.

func ActionHasEvent

func ActionHasEvent(action string, event InputEvent.Instance) bool

Returns true if the action has the given InputEvent associated with it.

func ActionSetDeadzone

func ActionSetDeadzone(action string, deadzone Float.X)

Sets a deadzone value for the action.

func AddAction

func AddAction(action string)

Adds an empty action to the InputMap with a configurable 'deadzone'.

An InputEvent can then be added to this action with ActionAddEvent.

func AddActionOptions

func AddActionOptions(action string, deadzone Float.X)

Adds an empty action to the InputMap with a configurable 'deadzone'.

An InputEvent can then be added to this action with ActionAddEvent.

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func EraseAction

func EraseAction(action string)

Removes an action from the InputMap.

func EventIsAction

func EventIsAction(event InputEvent.Instance, action string, exact_match bool) bool

Returns true if the given event is part of an existing action. This method ignores keyboard modifiers if the given InputEvent is not pressed (for proper release detection). See ActionHasEvent if you don't want this behavior.

If 'exact_match' is false, it ignores additional input modifiers for InputEventKey and InputEventMouseButton events, and the direction for InputEventJoypadMotion events.

func GetActionDescription

func GetActionDescription(action string) string

Returns the human-readable description of the given action.

func GetActions

func GetActions() []string

Returns an array of all actions in the InputMap.

func HasAction

func HasAction(action string) bool

Returns true if the InputMap has a registered action with the given name.

func LoadFromProjectSettings

func LoadFromProjectSettings()

Clears all InputEventAction in the InputMap and load it anew from ProjectSettings.

Types

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.InputMap

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

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