# How can I disable InputAction except some Input Action In Enhanced Input?

**URL:** <https://forums.unrealengine.com/t/how-can-i-disable-inputaction-except-some-input-action-in-enhanced-input/1205904>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [June 21, 2023, 2:57am UTC](https://forums.unrealengine.com/t/how-can-i-disable-inputaction-except-some-input-action-in-enhanced-input/1205904 "2023-06-21T02:57:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![gardian206](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gardian206](https://forums.unrealengine.com/u/gardian206)\
**Post date:** [June 21, 2023, 7:39am UTC](https://forums.unrealengine.com/t/how-can-i-disable-inputaction-except-some-input-action-in-enhanced-input/1205904/5 "2023-06-21T07:39:56Z")

</div>

in MappingContext1 `DefaultMappingContext` have all of your input actions assigned.  
then in MappingContext2 `OnlyWalkMappingContext` only place the Move\_InputAction

then in your trigger call a function that calls `Remove Mapping Context(DefaultMappingContext)` then `Add Mapping Context(OnlyWalkMappingContext)`  
just remember to have some situation where you call a function to do the opposite

you can also make it so that the function to swap over Mapping Contexts takes an Enum then the Enum feeds a `switch` to then assign the Mapping context based on the Enum.

don’t worry about unassigned a mapping context that isn’t assigned it is safe to do so, but assigning a Mapping Context of `none` is also safe, just no input at all until it is reassigned (this might be desired)

 ![MappingContextSwap](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/6/1062b08e9d5e4af8a0b2c08f8006a2f813731ac0.png)  
forgot the part where I assign to the `CurrentMappingContext` the `inMappingContext` but that should be trivial for the demonstration.

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-disable-inputaction-except-some-input-action-in-enhanced-input/1205904)._
