Setting IsFocused without setting IsFocusEngaged
Posted: 10 Apr 2021, 01:09
I'm trying to set the focus on a TextBox without engaging the TextBox. The target is a console application, so engaging the TextBox brings up the virtual keyboard, which I don't want to do until the user hits the confirm button. I do want the focus to be on the TextBox when the screen appears, though, so I need to set it to focused somehow. However, I've been struggling with finding a way to focus on the TextBox without engaging it. Whether I use SetFocusAction in the xaml or MoveFocus in the cpp, the TextBox always seems to engage when focused on, with the only exception being when I actually use a Gamepad's directional inputs to manually navigate to the TextBox (which isn't a viable option for setting initial focus). Even if I immediately change the IsFocusEngaged property, like so...
...it seems to be too late to keep the virtual keyboard from coming up. Is there some way to set the Focus to the TextBox without also setting IsFocusEngaged to True?
Code: Select all
<noesis:SetFocusAction />
<ei:ChangePropertyAction PropertyName="IsFocusEngaged" Value="False" />