Recently I’ve been working on an open sourced resource known as SocialChat. However, my resource lacks mobile support, in which I have tried to implement within the past month. Sadly, I have run into the issue of :CaptureFocus() failing to work as intended. I am not sure why this happens but I can’t seem to fix the issue regardless of what I do.
I made some code to ensure that it wasn’t just my something from my own behalf but my printing seems to work as intended.
DisplayLabel.InputBegan:Connect(function(Input)
print("DISPLAY LABEL INPUT?");
if ((Input.UserInputType == Enum.UserInputType.Touch) or (Input.UserInputType == Enum.UserInputType.MouseButton1)) then
ChatBox.CursorPosition = LastSavedCursorPosition
SetTextBoxVisible(false);
SetChatHidden(false);
print("TOUCH FOCUS");
ChatBox:CaptureFocus();
else
warn("(FAILED INPUT) Type:", Input.UserInputType);
end
end);
The functions prior to the :CaptureFocus event are synchronous callbacks which do not yield the code and only affect the chat visually. My issue is that my mobile keyboard seems to never come back after I lose focus on the TextBox.
So you’re saying when you tap out of chat it’s supposed to focus it again? Sorry for asking stupid questions. I just woke up and am in the airport, and on top of that I don’t know what your end goal is here and what exactly it isn’t doing correctly.
Basically what I’m showing in the video is that I am able to successfully send messages with my Chat system using :CaptureFocus. However, if the TextBox is actively already Focused and I do something to lose focus other than pressing the Return button on my mobile keyboard, CaptureFocus seems to never successfully bring up my keyboard again.
I clicked on the ChatBox which is what I was previously doing for the rest of my previous inputs. I am not sure but I believe this may possibly be an Engine Bug.
I tried this but it still seems to fail. It appears as though .Focused doesn’t fire when the bug occurs which signifies that :CaptureFocus does indeed fail to work as intended.
The video shows that I am able to use :CaptureFocus on Mobile to bring up the Keyboard for mobile client’s to type their own chat inputs into. This works perfectly fine whenever you click the TextBox and send your message. However, whenever you input text into the text box and lose focus on said TextBox, Mobile users are no longer able to pull up their mobile keyboards during a :CaptureFocus event regardless of the event actually being fired.
Heres a few details that may help with comprehension:
CaptureFocus does not fire BUT the code that fires said event does run. I have verified this through my output with the usage of prints and I am confident that there is nothing yielding the event from being fired.
This bug only occurs whenever a mobile client fires the CaptureFocus event, but then proceeds to fire the FocusLost event; thus preventing the mobile client from ever firing CaptureFocus ever again.