> ## Documentation Index
> Fetch the complete documentation index at: https://udcore.unrealdirective.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enhanced Input

### AddInputMappingContexts

Apply multiple Input Mapping Contexts.

<Tabs>
  <Tab title="Blueprint">
    <Frame type="glass">
      <img src="https://mintcdn.com/unrealdirective/rXPzDrZHlafDpvFa/images/blueprints/blueprint-library-addinputmappingcontexts.jpg?fit=max&auto=format&n=rXPzDrZHlafDpvFa&q=85&s=22bd5e0eef9c73d5d0e2f8a4a53e04f8" width="850" height="360" data-path="images/blueprints/blueprint-library-addinputmappingcontexts.jpg" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    AController* PlayerController = GetPlayerController();
    TArray<FUDCoreEnhancedInputContextData> Contexts; // Fill with the desired contexts
    bool bClearPrevious = false;
    EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::AddInputMappingContexts(PlayerController, Contexts, bClearPrevious);
    ```
  </Tab>
</Tabs>

**Inputs**

<ParamField path="PlayerController" type="AController*" required>
  The player controller to add the contexts to. Will attempt to get the LocalPlayer from the controller.
</ParamField>

<ParamField path="Contexts" type="TArray<FUDCoreEnhancedInputContextData>" required>
  The contexts to apply.
</ParamField>

<ParamField path="bClearPrevious" type="bool">
  Whether to clear all previous contexts before applying the new ones.
</ParamField>

**Outputs**

<ParamField path="ReturnValue" type="EUDSuccessStatus">
  Returns Success if the contexts were successfully applied.
</ParamField>

### RemoveInputMappingContexts

Remove multiple Input Mapping Contexts.

<Tabs>
  <Tab title="Blueprint">
    <Frame type="glass">
      <img src="https://mintcdn.com/unrealdirective/rXPzDrZHlafDpvFa/images/blueprints/blueprint-library-removeinputmappingcontexts.jpg?fit=max&auto=format&n=rXPzDrZHlafDpvFa&q=85&s=dacfd57140a8ea7282a13eede41205e0" width="850" height="360" data-path="images/blueprints/blueprint-library-removeinputmappingcontexts.jpg" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    AController* PlayerController = GetPlayerController();
    TArray<TSoftObjectPtr<UInputMappingContext>> Contexts; // Fill with the desired contexts
    EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::RemoveInputMappingContexts(PlayerController, Contexts);
    ```
  </Tab>
</Tabs>

**Inputs**

<ParamField path="PlayerController" type="AController*" required>
  The player controller to remove the contexts from. Will attempt to get the LocalPlayer from the controller.
</ParamField>

<ParamField path="Contexts" type="TArray<TSoftObjectPtr<UInputMappingContext>>" required>
  The contexts to remove.
</ParamField>

**Outputs**

<ParamField path="ReturnValue" type="EUDSuccessStatus">
  Returns Success if the contexts were successfully removed.
</ParamField>

### SwapInputMappingContexts

Swap a designated Input Mapping Context with a new one.

<Tabs>
  <Tab title="Blueprint">
    <Frame type="glass">
      <img src="https://mintcdn.com/unrealdirective/rXPzDrZHlafDpvFa/images/blueprints/blueprint-library-swapinputmappingcontexts.jpg?fit=max&auto=format&n=rXPzDrZHlafDpvFa&q=85&s=18e4ddbd9c6b3ac8affee87d11045add" width="850" height="360" data-path="images/blueprints/blueprint-library-swapinputmappingcontexts.jpg" />
    </Frame>
  </Tab>

  <Tab title="C++">
    ```cpp theme={null}
    AController* PlayerController = GetPlayerController();
    TSoftObjectPtr<UInputMappingContext> PreviousContext; // The context to swap out
    TSoftObjectPtr<UInputMappingContext> NewContext; // The context to swap in
    int32 Priority = 0;
    bool bUsePreviousPriority = false;
    EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::SwapInputMappingContexts(PlayerController, PreviousContext, NewContext, Priority, bUsePreviousPriority);
    ```
  </Tab>
</Tabs>

**Inputs**

<ParamField path="PlayerController" type="AController*" required>
  The player controller to swap the contexts on. Will attempt to get the LocalPlayer from the controller.
</ParamField>

<ParamField path="PreviousContext" type="TSoftObjectPtr<UInputMappingContext>" required>
  The context to swap out.
</ParamField>

<ParamField path="NewContext" type="TSoftObjectPtr<UInputMappingContext>" required>
  The context to swap in.
</ParamField>

<ParamField path="Priority" type="int32">
  The priority to set the new context to.
</ParamField>

<ParamField path="bUsePreviousPriority" type="bool">
  Whether to use the previous context's priority when adding the new context.
</ParamField>

**Outputs**

<ParamField path="ReturnValue" type="EUDSuccessStatus">
  Returns Success if the contexts were successfully swapped.
</ParamField>
