x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

SetKeyboardFocus not working in 4.18

The SetKeyboardFocus functions seems not work in 4.18. I created a widget with a text box. when I tap it, the keyboard shows up, but when I commit the text it goes alway. The commit lose focus option was disabled already. I tried to create a function to regain focus in the text box so the keyboard would be always visible but it's not working. Also tried in a new blank project.

Tried applying delays, User Focus, Set UI mode only. nothing worked :/ It was working fine in 4.16

Product Version: UE 4.18
Tags:
more ▼

asked Nov 03 '17 at 07:02 AM in Bug Reports

avatar image

brunogbrito
119 11 15 20

avatar image Tyler X ♦♦ STAFF Nov 03 '17 at 06:58 PM

Hello brunogbrito,

I will be glad to look into this for you.

Please provide the new project that you created to try this in so I can take a look at it.

Thanks, Tyler

avatar image brunogbrito Nov 07 '17 at 10:43 PM

Here it goes, check the level blueprint. What ever you try to use the SetKeyboardFocus it doesn't show up. It only shows in the screen if I tap the text box.

You can download the project here: https://www.dropbox.com/s/yyd3ve5ec9gi4lc/keyboard_test_2.rar?dl=0

avatar image Tyler X ♦♦ STAFF Nov 08 '17 at 06:22 PM

Hello,

Ok, I have been able to reproduce the issue you are describing, but I am unable to get it to work in 4.16 either. Can you elaborate on how you had it working in 4.16?

Thanks, Tyler

avatar image brunogbrito Nov 10 '17 at 04:03 AM

Hello Tyler,

First, I would like to thank you for your attention on this matter.

Maybe if I elaborate more what my needs are you can help me out:

What I'm trying to do is to show the mobile keyboard on the screen without having to tap the text box, and leave it there even if the text is commited or if the user clicks in other UMG buttons. In 4.16 I was able to manage that checking if the textbox keyboard focus was true all the time, if it loses the focus it would bring it back by setting the focus on it again. (It's not the best way but it was working before).

Could you maybe explain a better approach for this solution. I wish there was a function like: ShowVirtualKeyboard with a boolean so you could chose to bring the keyboard in or out (like Set Visibility) instead tapping the text box.

I found this documentation but I have no clue how to setup this on c++ or blueprints: https://docs.unrealengine.com/latest/INT/API/Runtime/Slate/Framework/Application/FSlateApplication/ShowVirtualKeyboard/index.html

Thanks, Bruno

avatar image Tyler X ♦♦ STAFF Nov 10 '17 at 05:43 PM

Hello,

Are you developing this for Android or iOS?

Thanks, Tyler

avatar image brunogbrito Nov 10 '17 at 05:51 PM

Hello Tyler,

Android

Thanks Bruno

avatar image brunogbrito Nov 11 '17 at 08:51 PM

API 19 using the latest sdk compiling with gradle

avatar image brunogbrito Nov 13 '17 at 06:41 PM

I was able to reproduce the right function in 4.16, Pasted the project files below:

Check the Level blueprint, after 5 seconds the mobile keyboard will show up.

https://www.dropbox.com/s/7565101skh6007x/keyboardtest6.rar?dl=0

avatar image brunogbrito Nov 13 '17 at 07:30 PM

Hello Tyler,

Complementing the previous post here goes the same project on 4.18, keyboard wont show up when you set the focus on it. Check the Level Blueprint. ps: you will need to make an Android mobile package and install in your phone to reproduce this error since PC doesn't have a virtual keyboard.

https://www.dropbox.com/s/tgo3qr9saosrdkh/keyboardtest7.rar?dl=0

I'm sorry the long delay, got busy with work those last days :/

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hello,

Thanks for your patience as I looked into this issue for you.

The issue here is that just because the text box has focus, this doesn't necessarily mean that Android is going to launch the virtual keyboard. I am not exactly sure why the method you were using in 4.16 worked, but that is not how this should be implemented.

From my research, there are two ways that you can do this. The most effective way would be to just build your own virtual keyboard as part of your UI. This will allow you complete control over when and where it displays, as well as how it will interact with the rest of your game.

The other option would be to tell Android to always show the virtual keyboard. This needs to be done using Java, and I found some information on doing this here: (Solution 3)

http://sterl.org/2016/02/android-show-keyboard-by-default/

My recommendation would be to build a virtual keyboard as part of your UI, as this would be the cleanest way to implement what you are trying to do.

Thanks, Tyler

more ▼

answered Nov 14 '17 at 02:15 PM

avatar image

Tyler X ♦♦ STAFF
272 2 3 2

avatar image brunogbrito Nov 14 '17 at 05:06 PM

Hello Tyler,

Thanks for your reply. The problem in creating my own custom virtual keyboard as part of our UI is that the game has multi-languages, we are using an API capable to deal with 82 different languages. So each most of them has its own keyboard configuration and special characters. I will take a look in the java solution instead, but in advance do you know where specifically should I tweak that in my project file or engine source?

I would appreciate if you could request to Chris Babcock to implement a ShowVirtualKeyboard funtion exposed in blueprints in a future update. I tried to build myself but I'm still not capable to construct it c++ ;)

Thank you for your time and attention once again

(comments are locked)
10|2000 characters needed characters left

I use SetText(" ") before SetKeyboardFocus to solve this problem. alt text

1.png (60.9 kB)
more ▼

answered Apr 16 '18 at 03:26 AM

avatar image

jiayuancen
1 1

avatar image brunogbrito May 03 '18 at 05:11 PM

Didn't work for me :/ I'm on 4.18 btw

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question