I have a MyTextBox widget with the following setup:
I overridden OnKeyUp and OnKeyDown:
Then I add this widget to the viewport from the map:
My problem is that when I type in the text box, only the OnKeyUp function is called and the OnKeyDown is never called. I tried to change the focusable property of the MyTextBox widget, but it doesn’t seem to make a difference.
Any ideas? I am using Unreal Engine 5.2.1.
My final goal is to allow the player to hold down the Up or Down key while the [Text Box] has the keyboard focus and the Text will be updated and iterated to older or newer history entries respectively. I have an object that keeps the user’s history so that the user can use the Up and Down arrow keys to navigate their history. It works well with just OnKeyUp to check both Up and Down keys and the user can go through one entry at a time.
However, I want the user to be able to navigate the history with speed by holding down either the Up or Down key. But I want the system to only begin scrolling through the history entries after the user has held down the Up or Down key for 150 ms so that the user can still go through one entry at a time.
I am open to workaround if my current approach worked around.
As workarounds, I tried using calling Is Input Key Down through the Player Controller and directly binding Up and Down keys in either the widgets or the Player Controller. They appear to work as long as the [Text Box] inside the MyTextBox widget does not have keyboard focus.