Documentation
¶
Overview ¶
Manages all graphics.gd/classdb/InputEventAction which can be created/modified from the project settings menu Project > Project Settings > Input Map or in code with AddAction and ActionAddEvent. See graphics.gd/classdb/Node.Instance.Input.
Index ¶
- func ActionAddEvent(action string, event InputEvent.Instance)
- func ActionEraseEvent(action string, event InputEvent.Instance)
- func ActionEraseEvents(action string)
- func ActionGetDeadzone(action string) Float.X
- func ActionGetEvents(action string) []InputEvent.Instance
- func ActionHasEvent(action string, event InputEvent.Instance) bool
- func ActionSetDeadzone(action string, deadzone Float.X)
- func AddAction(action string)
- func AddActionOptions(action string, deadzone Float.X)
- func Advanced() class
- func EraseAction(action string)
- func EventIsAction(event InputEvent.Instance, action string, exact_match bool) bool
- func EventIsActionOptions(event InputEvent.Instance, action string, exact_match bool) bool
- func GetActionDescription(action string) string
- func GetActions() []string
- func HasAction(action string) bool
- func LoadFromProjectSettings()
- type Extension
- type ID
- type Instance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionAddEvent ¶
func ActionAddEvent(action string, event InputEvent.Instance)
Adds an graphics.gd/classdb/InputEvent to an action. This graphics.gd/classdb/InputEvent will trigger the action.
func ActionEraseEvent ¶
func ActionEraseEvent(action string, event InputEvent.Instance)
Removes an graphics.gd/classdb/InputEvent from an action.
func ActionGetDeadzone ¶
Returns a deadzone value for the action.
func ActionGetEvents ¶
func ActionGetEvents(action string) []InputEvent.Instance
Returns an array of [graphics.gd/classdb/InputEvent]s associated with a given action.
Note: When used in the editor (e.g. a tool script or graphics.gd/classdb/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 graphics.gd/classdb/ProjectSettings.
func ActionHasEvent ¶
func ActionHasEvent(action string, event InputEvent.Instance) bool
Returns true if the action has the given graphics.gd/classdb/InputEvent associated with it.
func ActionSetDeadzone ¶
Sets a deadzone value for the action.
func AddAction ¶
func AddAction(action string)
Adds an empty action to the graphics.gd/classdb/InputMap with a configurable 'deadzone'.
An graphics.gd/classdb/InputEvent can then be added to this action with ActionAddEvent.
func AddActionOptions ¶
Adds an empty action to the graphics.gd/classdb/InputMap with a configurable 'deadzone'.
An graphics.gd/classdb/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 graphics.gd/classdb/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 graphics.gd/classdb/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 graphics.gd/classdb/InputEventKey and graphics.gd/classdb/InputEventMouseButton events, and the direction for graphics.gd/classdb/InputEventJoypadMotion events.
func EventIsActionOptions ¶
func EventIsActionOptions(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 graphics.gd/classdb/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 graphics.gd/classdb/InputEventKey and graphics.gd/classdb/InputEventMouseButton events, and the direction for graphics.gd/classdb/InputEventJoypadMotion events.
func GetActionDescription ¶
Returns the human-readable description of the given action.
func GetActions ¶
func GetActions() []string
Returns an array of all actions in the graphics.gd/classdb/InputMap.
func HasAction ¶
Returns true if the graphics.gd/classdb/InputMap has a registered action with the given name.
func LoadFromProjectSettings ¶
func LoadFromProjectSettings()
Clears all graphics.gd/classdb/InputEventAction in the graphics.gd/classdb/InputMap and load it anew from graphics.gd/classdb/ProjectSettings.
Types ¶
type Extension ¶
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
type 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.