Class InputBinding
Represents a binding between an input and a command. Defines how input events are mapped to command execution.
public class InputBinding
- Inheritance
-
InputBinding
- Inherited Members
Constructors
InputBinding()
Creates a new input binding.
public InputBinding()
InputBinding(string, InputKey, IInputCommand, InputTriggerType, bool)
Creates a new input binding with the specified properties.
public InputBinding(string id, InputKey inputKey, IInputCommand command, InputTriggerType triggerType = InputTriggerType.Pressed, bool enabled = true)
Parameters
idstringUnique identifier for the binding
inputKeyInputKeyThe input key that triggers this binding
commandIInputCommandThe command to execute
triggerTypeInputTriggerTypeHow the input trigger is handled
enabledboolWhether the binding is enabled
Properties
Command
The command to execute when the input is triggered.
public IInputCommand Command { get; set; }
Property Value
Enabled
Whether this binding is currently enabled.
public bool Enabled { get; set; }
Property Value
Id
Unique identifier for this binding.
public string Id { get; set; }
Property Value
InputKey
The input key that triggers this binding.
public InputKey InputKey { get; set; }
Property Value
Parameters
Optional parameters to pass to the command when executed.
public object[] Parameters { get; set; }
Property Value
- object[]
RepeatDelay
Delay before repeat triggers start (in seconds). Only used with TriggerType.Repeat.
public float RepeatDelay { get; set; }
Property Value
RepeatRate
Rate of repeat triggers (in seconds between triggers). Only used with TriggerType.Repeat.
public float RepeatRate { get; set; }
Property Value
TriggerType
How the input trigger is handled (Pressed, Released, Held, Repeat).
public InputTriggerType TriggerType { get; set; }
Property Value
Methods
Execute()
Executes the bound command if the binding is enabled.
public void Execute()
Matches(InputKey)
Checks if this binding matches the given input key.
public bool Matches(InputKey inputKey)
Parameters
inputKeyInputKeyThe input key to check
Returns
- bool
True if the binding matches the input key
ToString()
Returns a string representation of the binding.
public override string ToString()