Game.Input.ICustomComposite
Assembly:
Assembly-CSharp (Cities: Skylines 2 game/modding assembly)
Namespace: Game.Input
Type: Interface
Base: None (interface)
Summary: Interface describing a custom input composite used by the game's input system. This interface exposes a set of default flags and a set of read-only properties that describe how the composite behaves in the rebind system, whether modifiers are allowed/rebindable, visibility, developer-only status, platform targeting, option-group overrides, usages and parameters associated with the composite, and an optional linked GUID. Implementers provide these property values so the game/mod input framework can correctly present, bind, and serialize the composite. The interface also exposes a convenience static property for obtaining a mutable default Usages collection.
Fields
-
const bool kDefaultIsRebindable = true
Default value for the isRebindable property; indicates the composite is rebindable by default. -
const bool kDefaultIsModifiersRebindable = true
Default value for the isModifiersRebindable property; indicates modifier keys (if applicable) are rebindable by default. -
const bool kDefaultAllowModifiers = true
Default value for allowModifiers; allows modifiers to be used with this composite by default. -
const bool kDefaultCanBeEmpty = true
Default value for canBeEmpty; the composite can be left empty (no binding) by default. -
const bool kDefaultDeveloperOnly = false
Default value for developerOnly; composite is not restricted to developer-only usage by default. -
const bool kDefaultBuiltIn = true
Default value for builtIn; composite is considered a built-in composite by default. -
const bool kDefaultIsDummy = false
Default value for isDummy; composite is not a dummy placeholder by default. -
const bool kDefaultIsHidden = false
Default value for isHidden; composite is visible in UI lists by default. -
const Mode kDefaultMode = Mode.DigitalNormalized
Default Mode for the composite (Mode is an enum elsewhere in the input types); indicates the composite operates in digital normalized mode by default. -
const OptionGroupOverride kDefaultOptionGroupOverride = OptionGroupOverride.None
Default option-group override setting; no override by default. -
const Platform kDefaultPlatform = Platform.All
Default platform target; composite applies to all platforms by default.
Properties
-
bool isRebindable { get; }
Whether this composite may be rebound by users. Default: kDefaultIsRebindable. -
bool isModifiersRebindable { get; }
Whether modifier keys used in this composite are rebindable independently. Default: kDefaultIsModifiersRebindable. -
bool allowModifiers { get; }
Whether modifiers are allowed to be combined with this composite. Default: kDefaultAllowModifiers. -
bool canBeEmpty { get; }
Whether the composite may be left unbound/empty. Default: kDefaultCanBeEmpty. -
bool developerOnly { get; }
Whether the composite should only be visible/usable by developers or debug builds. Default: kDefaultDeveloperOnly. -
Platform platform { get; }
Platform(s) for which the composite is applicable (Platform enum). Default: kDefaultPlatform. -
bool builtIn { get; }
Whether the composite is considered built-in by the game. Default: kDefaultBuiltIn. -
bool isDummy { get; }
Flag indicating a dummy/placeholder composite. Default: kDefaultIsDummy. -
bool isHidden { get; }
Whether the composite is hidden from user-facing lists/UI. Default: kDefaultIsHidden. -
Usages usages { get; }
A Usages collection describing the semantic usages (labels) for controls produced by this composite (e.g., "Primary", "Secondary", "Aim"). Use this to help the UI show meaningful names and for matching expected control usages. -
NameAndParameters parameters { get; }
Name and parameters associated with this composite. Useful when the composite is configured with named parameters (for serialization, UI display or variant behavior). -
OptionGroupOverride optionGroupOverride { get; }
Option group override control—used by the game's input/options UI to group or override grouping for this composite. Default: kDefaultOptionGroupOverride. -
Guid linkedGuid { get; }
Optional GUID used to link this composite to another definition or resource (e.g., for shared/grouped bindings). -
static Usages defaultUsages => Usages.defaultUsages.Copy(readOnly: false);
Static convenience property returning a mutable copy of the default Usages collection. Use when implementing usages to start from the game's default usage list.
Constructors
- None. Interfaces do not declare constructors.
Methods
- None declared on this interface. All members are constants and properties (including a static property).
Usage Example
using System;
using UnityEngine.InputSystem.Utilities;
using Game.Input;
// Simple example implementation of ICustomComposite for modders.
// This is illustrative — adapt to your composite's actual behavior and types.
public class MyCustomComposite : ICustomComposite
{
// Use defaults from the interface constants unless you need custom behavior.
public bool isRebindable => ICustomComposite.kDefaultIsRebindable;
public bool isModifiersRebindable => ICustomComposite.kDefaultIsModifiersRebindable;
public bool allowModifiers => ICustomComposite.kDefaultAllowModifiers;
public bool canBeEmpty => ICustomComposite.kDefaultCanBeEmpty;
public bool developerOnly => ICustomComposite.kDefaultDeveloperOnly;
public Platform platform => ICustomComposite.kDefaultPlatform;
public bool builtIn => ICustomComposite.kDefaultBuiltIn;
public bool isDummy => ICustomComposite.kDefaultIsDummy;
public bool isHidden => ICustomComposite.kDefaultIsHidden;
public OptionGroupOverride optionGroupOverride => ICustomComposite.kDefaultOptionGroupOverride;
// Provide usages and parameters appropriate to your composite.
// Start from the default editable usages if you want the default set.
public Usages usages => ICustomComposite.defaultUsages;
// Example parameters — construct as appropriate for your composite.
public NameAndParameters parameters => new NameAndParameters("example");
// Optional GUID linking
public Guid linkedGuid => Guid.Empty; // Or some persistent Guid if needed
}
Additional notes for modders: - Mode, OptionGroupOverride, Platform, Usages, NameAndParameters are types defined elsewhere in the game's input system / Unity Input System. Check the corresponding types in the assembly for exact enum values and helpers. - Implement this interface when you need the game's binding UI/system to recognize and correctly present a custom composite, especially for rebind support, platform filtering, and option grouping. - Use ICustomComposite.defaultUsages to obtain a mutable copy of the game's default usages collection if you want to start from defaults and add/remove usage entries.