Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class InputBinding

    Represents a binding between an input and a command. Defines how input events are mapped to command execution.

    Inheritance
    object
    InputBinding
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: PopcorningGuineaPig.Engine.Input
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public class InputBinding

    Constructors

    | Edit this page View Source

    InputBinding()

    Creates a new input binding.

    Declaration
    public InputBinding()
    | Edit this page View Source

    InputBinding(string, InputKey, IInputCommand, InputTriggerType, bool)

    Creates a new input binding with the specified properties.

    Declaration
    public InputBinding(string id, InputKey inputKey, IInputCommand command, InputTriggerType triggerType = InputTriggerType.Pressed, bool enabled = true)
    Parameters
    Type Name Description
    string id

    Unique identifier for the binding

    InputKey inputKey

    The input key that triggers this binding

    IInputCommand command

    The command to execute

    InputTriggerType triggerType

    How the input trigger is handled

    bool enabled

    Whether the binding is enabled

    Properties

    | Edit this page View Source

    Command

    The command to execute when the input is triggered.

    Declaration
    public IInputCommand Command { get; set; }
    Property Value
    Type Description
    IInputCommand
    | Edit this page View Source

    Enabled

    Whether this binding is currently enabled.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Id

    Unique identifier for this binding.

    Declaration
    public string Id { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    InputKey

    The input key that triggers this binding.

    Declaration
    public InputKey InputKey { get; set; }
    Property Value
    Type Description
    InputKey
    | Edit this page View Source

    Parameters

    Optional parameters to pass to the command when executed.

    Declaration
    public object[] Parameters { get; set; }
    Property Value
    Type Description
    object[]
    | Edit this page View Source

    RepeatDelay

    Delay before repeat triggers start (in seconds). Only used with TriggerType.Repeat.

    Declaration
    public float RepeatDelay { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    RepeatRate

    Rate of repeat triggers (in seconds between triggers). Only used with TriggerType.Repeat.

    Declaration
    public float RepeatRate { get; set; }
    Property Value
    Type Description
    float
    | Edit this page View Source

    TriggerType

    How the input trigger is handled (Pressed, Released, Held, Repeat).

    Declaration
    public InputTriggerType TriggerType { get; set; }
    Property Value
    Type Description
    InputTriggerType

    Methods

    | Edit this page View Source

    Execute()

    Executes the bound command if the binding is enabled.

    Declaration
    public void Execute()
    | Edit this page View Source

    Matches(InputKey)

    Checks if this binding matches the given input key.

    Declaration
    public bool Matches(InputKey inputKey)
    Parameters
    Type Name Description
    InputKey inputKey

    The input key to check

    Returns
    Type Description
    bool

    True if the binding matches the input key

    | Edit this page View Source

    ToString()

    Returns a string representation of the binding.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.