UEnhancedInputLocalPlayerSubsystem::RemoveMappingContext
#include "EnhancedInputSubsystems.h"
Access: public
Specifiers: virtual
Description
Removes a UInputMappingContext from the active set. Inputs from that context stop firing immediately.
Signature
virtual void RemoveMappingContext(const UInputMappingContext* MappingContext, const FModifyContextOptions& Options = FModifyContextOptions()) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MappingContext | const UInputMappingContext* | The context to deactivate. | — |
| Options | const FModifyContextOptions& | Options for how the removal is applied. | FModifyContextOptions() |
Return Type
void Caveats & Gotchas
- • Removing a context that is not currently active is a safe no-op — no error or warning.
- • If the same context was added multiple times (e.g. by different systems), a single RemoveMappingContext removes it entirely regardless of how many times it was added.
Example
Remove vehicle context on exit C++
void AMyCharacter::OnExitVehicle()
{
if (UEnhancedInputLocalPlayerSubsystem* Sub = GetEnhancedInputSubsystem())
{
Sub->RemoveMappingContext(VehicleContext);
Sub->AddMappingContext(DefaultContext, 0);
}
} See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?