Hello!
I created a widget for a separate slot. Then I created a widget of a separate component from these slots. And then I use these components to compose the main widget. I want to create an event which be triggered in the widget slot when I hover over it with the mouse and press some key on the keyboard (for certainty, let it be ‘E’)
I assume that this is done through the OnKeyDown event, but it didn’t work out for me. (I was trying to just output a message).
Honestly, I do not know which images I can attach to the question. Therefore, if something is required, I am ready to attach it.
Updated:
I tried checking constantly to see if IsHovered is True. And if so, then set the focus on this widget component
But I use about a hundred of these elements. And I am confused by the performance of this solution
Updated_Update:
So, I discovered “Event On Mouse Entering” and “Event On Mouse Leaving”
I change focus to widget when I entering and change focus to Viewport when I leaving
But I have a problem. This widget is hidden or shown when you press a button on the keyboard. And this is detected using the Enhanced Input Action in BP_Player. But with this implementation, when pointing at the slot widget, the input to BP_Player is disabled. So I this
In BP_Player, I created an additional event, which I tied to the same logic as EnchancedInput. And I call this event when pressing the same button, but being in the focus of the widget
I don’t particularly like this realization. Is there a way to do otherwise? And also is it possible to translate OnKeyDown to EnhancedInput in this situation?