Function virtualButton

  • Registers a VirtualButton with the VirtualInput.defaultConfiguration and assigns it to the decorated field.

    Parameters

    • name: string

      Unique name used to access the virtual button.

    • buttonCode: EnumValue<ButtonCode, number> | EnumValue<ButtonCode, number>[]

      Physical button the virtual button is triggered by, or an array of ButtonCode enum values.

    • Optionalmodifiers: EnumValue<ButtonModifier, number>

      Modifiers required to be pressed with the physical button to trigger the virtual button.

    • Optionalrepeatable: boolean

      If true, the virtual button events will be sent continually while the physical button is being held.

    • Optionalcategory: string

      The category of the button, if undefined, the default category will be used.

    Returns AttributeDecorator<Attribute>

    The target of the decorator must be a static field of type VirtualButton.

    If the name already exists in the specified category the previous registration is returned.

    Each category only supports each name uniquely per ButtonCode.