RealDocs

UEnhancedInputLocalPlayerSubsystem::ClearAllMappings

function EnhancedInput Blueprint Since 5.0
#include "EnhancedInputSubsystemInterface.h"
Access: public Specifiers: virtual

Description

Removes all active UInputMappingContexts from this player's subsystem at once. All input stops firing until new contexts are added.

Signature

virtual void ClearAllMappings()

Return Type

void

Caveats & Gotchas

  • Use with care — this removes every active context including any added by other systems (UI, vehicles, abilities). Re-add all required contexts after calling this.
  • Prefer RemoveMappingContext for selective removal. ClearAllMappings is suited to clean-slate scenarios like returning to main menu or level transitions.

Example

Clean slate before applying a new context set C++
void AMyPlayerController::OnLevelTransition()
{
	if (UEnhancedInputLocalPlayerSubsystem* Sub = GetEnhancedInputSubsystem())
	{
		Sub->ClearAllMappings();
		Sub->AddMappingContext(MenuContext, 0);
	}
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.