# How do I set "Receive Hardware Input" for a widget component added at runtime?

**URL:** <https://forums.unrealengine.com/t/how-do-i-set-receive-hardware-input-for-a-widget-component-added-at-runtime/2505765>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [May 12, 2025, 9:46am UTC](https://forums.unrealengine.com/t/how-do-i-set-receive-hardware-input-for-a-widget-component-added-at-runtime/2505765 "2025-05-12T09:46:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [May 12, 2025, 9:46am UTC](https://forums.unrealengine.com/t/how-do-i-set-receive-hardware-input-for-a-widget-component-added-at-runtime/2505765/1 "2025-05-12T09:46:59Z")

</div>

Hi, so I have an actor component on my player character through which I’m adding ANOTHER widget component at runtime:

 ![Capture](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/b/33b05b3cd42776bccfbf50af58672eceb97b41c5.png)  
I can’t find the “Receive Hardware Input” variable to set it to true, like in a widget component that’s added manually:  
 ![Capture](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/d/63d2c4ae2fb6e460dc1f79e960dad0dfe677aba5.png)  
Please help!!

---

<div class="post-metadata">

**Author:** ![CheapMeow](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cheapmeow/32/1009431_2.png) [@CheapMeow](https://forums.unrealengine.com/u/CheapMeow)\
**Post date:** [July 29, 2025, 6:52am UTC](https://forums.unrealengine.com/t/how-do-i-set-receive-hardware-input-for-a-widget-component-added-at-runtime/2505765/2 "2025-07-29T06:52:25Z")

</div>

## ReceiveHardwareInput is not exposed to blueprint

Just see `WidgetComponent` class source code, you can find

```cpp
protected:
	UPROPERTY(EditAnywhere, Category=Interaction)
	bool bReceiveHardwareInput;

```

There is not a function to modify it, and it is a protected variable, so it is not exposed to blueprint.

But it is UPROPERTY, so you can modify it in property window.

## Example usage of bReceiveHardwareInput UPROPERTY

Example blueprint

[CreateWidgetComponent posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/injv_tzl/)

Host actor where example blueprint lies

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/1/74143ebe920b3241a44875b79f002c69438ff1be.png)

Here we prepare a template of `WidgetComponent` in a existing actor, its `bReceiveHardwareInput=true`. When we need to add widget component to somebody, attach it to the one who really need it. It is troublesome but don’t need to modify source code. The reason is explained below

## Reason of troublesome usage

When level is loaded, all components are registered.  
At the `WidgetComponent` register function, it will call `CanReceiveHardwareInput()` to determine whether to register a HitTester into viewport.  
HitTester is a helper class to call `GetHitResultAtScreenPosition()` to capture `WidgetComponent` and the UI clicked. It is called every frame.  
If not, the `WidgetComponent` will not register HitTester, then even though you set `bReceiveHardwareInput=true` by your custom cpp function, HitTester will not be created again.  
So, use `CreateComponentByClass` to create a `WidgetComponent` is a bad idea, because the default value of `bReceiveHardwareInput` is false.  
The solution is create a `WidgetComponent` in blueprint, and set `bReceiveHardwareInput=true`, then will game init, the WidgetComponent deserialization will read blueprint value. Or create a custom cpp class to derive from `WidgetComponent` class, override default value of `bReceiveHardwareInput=true`.
