TextBox FocusLost's EnterPressed is False

On some tablet devices, when the TextBox FocusLost event is fired, EnterPressed is always false. Below is a video depicting a user pressing the return key (lower right hand corner, a bit obstructed by watermark), yet the message isn’t sending on our TextBox. I did some debugging with this user and noticed enterPressed was never being set to true. This specific user has a “Cherry Mobile Magnum 10”, and others with different tablets reported the same issue. I was unable to reproduce this on an iPad, and any user I asked reported it being an android OS tablet.

Update: So far 2 users stated they were previously using GBoard, and when they switched to SwiftKey the issue was resolved. Other device was a Lenovo Tab4 8Plus

7 Likes

Hi, I have tested this issue on my own games and on ERLC and found that it works fine with my Samsung Galaxy Tab A. I am wondering if the user also experiences this on other games or just ERLC. I have noted though that ERLC already uses some chat modifications and has seen issues especially with a player death breaking their chat.
Perhaps a fix could be to fork the chat service by checking if the user is on mobile and then use ContextActionService to bind Enum.KeyCode.Return? If it is not the same keycode, then try printing the value of ‘Return’ on the device and find it in the Keycode glossary. (Granted that you could just do it in the reverse order and skip any possibility of ‘Return’ not being the same value of Enum.KeyCode.Return.)

1 Like

KeyCode to my knowledge is only for physical keyboards, as I did try that and it returned “Unknown” and rightfully so, since it’s a Touch input. I suppose the issue only occurs on less popular android operated tablets? We just posted a request for any user experiencing the problem to start reporting what devices they’re using so we can update this post with them.

2 Likes

Good point. Unknown always shares the value ‘0’ which seems to make it impossible to resolve on your side. That said, this opens the possibility that it may not be limited in particular to the device but rather the keyboard software. The client may be able to use a custom keyboard such as Microsoft Swiftkey, Gboard, etc which might provide a value that will be recognized.

2 Likes

Great point! This specific user tried GBoard, it didn’t work, and then tried Swiftkey and it worked. Since it seems it’s on a per-keyboard-basis, support for GBoard would be much appreciated considering it’s one of the leading keyboards on android tablets. If, however, support is unable to be given, some sort of notification that “You are using an unsupported keyboard” would be appreciated so they aren’t coming to devs with the issue.

2 Likes

I just now tested Gboard. Here’s what I have noticed:
Gboard works fine with the default chat. I ran a test game and Gboard is already supported. It seems like some sort of modifications to the chat on ERLC have caused the issue.


On the ERLC video, when the keyboard recedes, I had tapped out of it.

1 Like

Ours is just a text box where we listen for focus lost and see if enterpressed is true

1 Like

Hi Shawn, I was able to get enterpressed to return true on my end. Here is my finding.
The bool property ‘MultiLine’ dictates whether the keyboard will use ‘Return’ or ‘Enter/Send’. Disable this to return normal functionality.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.