WidgetInteraction->SendKeyChar() does not work in UE 5.1?

Hi everyone,

I just switched from UE 5.0 to 5.1 for a VR project that had a working 3D UI with text boxes and a virtual keyboard based on https://docs.unrealengine.com/5.1/en-US/creating-virtual-keyboard-interactions-in-unreal-engine/.

After the switch I had problems with the game losing focus after interacting with the UI so that only the first interaction went through. Switching to the new EnhancedInput system the focus problem seems to be fixed, but SendKeyChar() both using Blueprint and C++ does not work and always returns false.

This can quickly be reproduced in the Virtual Reality template:

  1. Add a TextBox to WidgetMenu. You can now select the text box using the controller pointer and enter characters using the PC keyboard.
  2. Add a new InputAction and assign a controller button to it in IMC_Menu.
  3. In the Menu blueprint call SendKeyChar() when the input action is triggered.

This always returns false and the character is not sent to the text box.

Am I missing something or is this a bug?

@anon33985116
Is your output always false?
-Zen

Yes, SendKeyChar() always returns false.

To follow up on this: As it turns out, SendKeyChar() is not the problem here, but a change to PressPointerKey(). For now, I reverted this commit and it fixed the problem. Relevant bug report here (UE-166377).

1 Like