0 votes
by (190 points)

Hi,

I'm using the Unreal XR SDK for the Pico Neo 3 Pro and when I click on a text box, it opens the default software keyboard in front of my screen as if it's a normal Android device.

How do I fix this? There doesn't seem to be anything in the code for me to disable it so help would be appreciated.

It's Unreal XR SDK version 2.0.4
And UE4 4.26.2

2 Answers

0 votes
by (190 points)
 
Best answer

Thanks for that, but that example wasn't a viable option for us.

But I did find a solution that actually could be included in the PicoXR SDK.

I added a custom UPL.xml and created a keyboard that creates a new VirtualKeyboardInput, assigning it to the input and it carries the following functionality.

<gameActivityClassAdditions>
  <insert>
    public class HiddenVirtualKeyboardInput extends VirtualKeyboardInput
    {
      public HiddenVirtualKeyboardInput(Context context, AttributeSet attrs, int defStyle)
      {
        super(context, attrs, defStyle);
      }

      public HiddenVirtualKeyboardInput(Context context, AttributeSet attrs)
      {
        super(context, attrs);
      }

      public HiddenVirtualKeyboardInput(Context context)
      {
        super(context);
      }

      public void setVisibility(int visibility)
      {
        // 8 is the number for hidden, probably could use View.GONE instead
        super.setVisibility(8);
      }
    }
  </insert>
</gameActivityClassAdditions>

<!-- optional additions to GameActivity onCreate in GameActivity.java -->
<gameActivityOnCreateAdditions>
  <insert>
    newVirtualKeyboardInput = new HiddenVirtualKeyboardInput(this);
    newVirtualKeyboardInput.setVisibility(View.GONE);
  </insert>
</gameActivityOnCreateAdditions>

Sadly, you cannot just set newVirtualKeyboardInput to null as it'll crash because there is no null checking. There needs to be a better solution built in that resolves this issue in Unreal Engine itself, but this solves the problem quite nicely.

0 votes
by (24.7k points)

Dear developer,

Sorry, the keyboard of Android system will open when you click the input box in UE4, which cannot be used normally. You need to avoid using the input box provided by UE4.
You can refer to our UIInteractionUE4 demo to make your own input box and keyboard to avoid opening the Android keyboard.
https://github.com/picoxr/UI_Interaction_UE4

by (190 points)

Thanks for that, but that example wasn't a viable option for us.

But I did find a solution that actually could be included in the PicoXR SDK.

I added a custom UPL.xml and created a keyboard that creates a new VirtualKeyboardInput, assigning it to the input and it carries the following functionality.

<gameActivityClassAdditions>
  <insert>
    public class HiddenVirtualKeyboardInput extends VirtualKeyboardInput
    {
      public HiddenVirtualKeyboardInput(Context context, AttributeSet attrs, int defStyle)
      {
        super(context, attrs, defStyle);
      }

      public HiddenVirtualKeyboardInput(Context context, AttributeSet attrs)
      {
        super(context, attrs);
      }

      public HiddenVirtualKeyboardInput(Context context)
      {
        super(context);
      }

      public void setVisibility(int visibility)
      {
        // 8 is the number for hidden, probably could use View.GONE instead
        super.setVisibility(8);
      }
    }
  </insert>
</gameActivityClassAdditions>

<!-- optional additions to GameActivity onCreate in GameActivity.java -->
<gameActivityOnCreateAdditions>
  <insert>
    newVirtualKeyboardInput = new HiddenVirtualKeyboardInput(this);
    newVirtualKeyboardInput.setVisibility(View.GONE);
  </insert>
</gameActivityOnCreateAdditions>

Sadly, you cannot just set newVirtualKeyboardInput to null as it'll crash because there is no null checking. There needs to be a better solution built in that resolves this issue in Unreal Engine itself, but this solves the problem quite nicely.

...