I have provided a link to documentation that goes over the nodes used to set input. The nodes such as “Set input game only” will help you manage your inputs. I hope that this information helps.
Link: Creating Widgets in Unreal Engine | Unreal Engine 5.1 Documentation