# How to completely prevent mouse input from being transmitted to game logic without affecting UI logic

**URL:** <https://forums.unrealengine.com/t/how-to-completely-prevent-mouse-input-from-being-transmitted-to-game-logic-without-affecting-ui-logic/1855764>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [May 14, 2024, 2:51pm UTC](https://forums.unrealengine.com/t/how-to-completely-prevent-mouse-input-from-being-transmitted-to-game-logic-without-affecting-ui-logic/1855764 "2024-05-14T14:51:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2024, 9:47am UTC](https://forums.unrealengine.com/t/how-to-completely-prevent-mouse-input-from-being-transmitted-to-game-logic-without-affecting-ui-logic/1855764/6 "2024-05-15T09:47:09Z")

</div>

> [@ElectricRhino597](#):
>
> but there is an new problem that is my EnhancedInputAction IA\_bag is set in BP\_Charactor. Thus, my bag ui can not be closed normally. How should I do?

Implement closing inside the inventory:

- `onKeyDown` (or EI) → close inv → `Input Mode Game & UI`

* * *

Also, EI supports context mapping with priority. Nothing stops you from adding an entire new input scheme that works only inside the UI and consumes all else. As in:

> [@"Consume input" doesn't work (the input still propagates everywhere)](https://forums.unrealengine.com/t/consume-input-doesnt-work-the-input-still-propagates-everywhere/1213316/4):
>
> Imagine I have 2 sets of controls: IMC\_Default (Priority 0) to move around with WASD IMC\_Backpack (Priority 1) to move between backpack slots, also with WASD if priorities are equal, the one added last gets to the hardware input first When I open my backpack and WASD inside it, I’d rather not walk off the cliff, so I add a new Mapping Context with higher priority, so it can intercept Actions associated with keys: Think with mapping contexts - abstracted layers of input. I…

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-completely-prevent-mouse-input-from-being-transmitted-to-game-logic-without-affecting-ui-logic/1855764)._
