Currently, with the addition of chat on consoles, our console players are experiencing issues sending messages in our game Emergency Hamburg, which uses a custom chat system.
After some testing, we noticed that the FocusLost Event, which we use for sending messages (and in other places), does not fire on consoles, which makes console players currently unable to send messages in our game. I would of course expect FocusLost to fire on consoles as well, as it’s the same thing as on pc and mobile.
Reproduction Place: Console FocusLost Bug Report - Roblox
When unfocusing the TextBox in the reproduction place on mobile or PC, players can see a notification in the bottom right corner that includes the info if enter has been pressed. This does not happen on consoles.
I am aware that there is a ReturnPressedFromOnScreenKeyboard, but for some usages we have of FocusLost (e.g. autosaving some input text), this doesn’t work because it requires return to be pressed which is something we do not need there. Also, the behavior is simply inconsistent because FocusLost is fired on mobile even though ReturnPressedFromOnScreenKeyboard is also fired, which would require some kind of debounce system.
Are you able to connect to ReturnPressedFromOnScreenKeyboard and then manually call textbox:ReleaseFocus()? You can then override enterPressed based on what you need.
I’m not sure why we don’t automatically release focus on the textbox on Console, but maybe that’s just the default behavior. I can look into it more if you want.
Great idea! For the scenarios where we check if enterPressed is true, this could work as it solves the issue with both events being called. I’ll test it and let you know if it works.
In the cases where we don’t check if enter is pressed (like just auto-saving configuration settings for users, we don’t care if enter was pressed or not, we want to know if the user finished editing the text), I think this won’t work because ReturnPressedFromOnScreenKeyboard is only called if enter was pressed.
I think it would be worth looking into, as many Devs rely on FocusLost behavior even without enter being pressed. If that’s intentional, then there probably should be some ReturnPressedFromOnScreenKeyboard, but without requiring return to be pressed.
For consoles, I think ReturnPressedFromOnScreenKeyboard should be called if the user exits the on-screen keyboard via confirmation instead of cancelling and they shouldn’t need to actually press Enter. Could you let me know if this is or isn’t the case?