Class InputContextExclusivity
Decides whether two contexts, or two action maps, can ever be live at the same time. This is the single rule both conflict detection systems consult when deciding whether a shared control is a real collision or two modes reusing one key.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public static class InputContextExclusivity
Remarks
Exclusivity is declared, never inferred from the blocking model. Neither Priority nor BlocksLowerPriority nor ConsumesAllInput takes any part in these decisions. A game that wants two contexts treated as mutually exclusive says so by giving them a shared entry in ConflictExclusiveTags, and nothing else will produce that result.
The map-level rule has a second clause that is easy to miss and expensive to omit. Tags sit on contexts, but conflicts are between bindings, which live in action maps, so the map rule has to cross from one to the other. A map that some single context enables alongside another map is never exclusive with it, whatever the tags say, because that one context is proof the two are live together. This is what protects an always-on map, the kind that appears in every context's enabled list to carry screenshot or pause hotkeys: without the clause, tagging the contexts that enable it would suppress every genuine collision against it. That clause reads EnabledActionMaps, which is the same authored data as the tags, not the blocking flags.
Both comparisons are case-insensitive, matching how action map names and tags are compared everywhere else in the module.
Methods
AreContextsExclusive(InputContext, InputContext)
Reports whether two contexts are mutually exclusive, meaning they are never active at the same time and a control they share is not a real conflict.
Declaration
public static bool AreContextsExclusive(InputContext contextA, InputContext contextB)
Parameters
| Type | Name | Description |
|---|---|---|
| InputContext | contextA | First context. May be |
| InputContext | contextB | Second context. May be |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Two contexts are exclusive when they share at least one conflict-exclusive tag. A context is never exclusive with itself, and an untagged context is never exclusive with anything, so leaving the tags empty is the conservative default that reports every overlap.
AreMapsExclusive(IReadOnlyList<InputContext>, string, string)
Reports whether two action maps are mutually exclusive, meaning no reachable state of the game has both of them enabled, so a control they share is not a real conflict.
Declaration
public static bool AreMapsExclusive(IReadOnlyList<InputContext> contexts, string mapA, string mapB)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputContext> | contexts | Every registered context, usually GetAllContexts().
A |
| string | mapA | First action map name. |
| string | mapB | Second action map name. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
All three of these must hold:
- At least one context enables each map. A map no context mentions is not known to be exclusive with anything.
- No single context enables both. One context enabling both is direct evidence they are live together, and it outranks any tag agreement.
- Every context enabling the first is exclusive with every context enabling the second, per AreContextsExclusive(InputContext, InputContext). One untagged context on either side is enough to make the pair non-exclusive, which is deliberate: it means a map reached from a mode nobody tagged keeps reporting its overlaps.
A map is never exclusive with itself; two rows of one map always conflict.