FocusLost for Console

So I’ve attempted to use FocusLost for a chat system, and it doesn’t seem to work on console devices.

First Attempt

self:NewEventSignal(Message.FocusLost:Connect(function(Enter) -- Basic Event Signal (works the same any other way.)
	if Enter then -- False when trying what I did on the video below.
		local Trimmed = Strip(Message.Text)
		Message.Text = ""

		if Trimmed ~= "" then
			GetTextChannel(IsTeamChat):SendAsync(Trimmed)
		end
	end

	CloseMessage()
end))

Second Attempt - Tried to make a Console-only version for “TextBoxFocusReleased”

-- Consoles
self:NewEventSignal(UserInputService.TextBoxFocusReleased:Connect(function(TextBox)
	if TextBox == Message then
		if Settings:OnConsole() then -- Console only
			local Trimmed = Strip(Message.Text)
			Message.Text = ""

			if Trimmed ~= "" then
				GetTextChannel(IsTeamChat):SendAsync(Trimmed)
			end
		end
			
		CloseMessage()
		end
end))

-- Other Devices
self:NewEventSignal(Message.FocusLost:Connect(function(Enter)
	if Enter and not Settings:OnConsole() then -- Stops consoles
		local Trimmed = Strip(Message.Text)
		Message.Text = ""

		if Trimmed ~= "" then
			GetTextChannel(IsTeamChat):SendAsync(Trimmed)
		end
	end

	CloseMessage()
end))

That also didn’t work (shocker)

I’ve discovered whenever the player uses the “Done” button on Xbox or PlayStation, it does not register as FocusLost properly in-game.

I tested the controller on Xbox and PC. When I open the Console Menu on PC, it counts FocusLost.
Exiting the menu, it doesn’t.

Example - On PC, but it has the same effect on other devices.

Apologies if this isn’t the easiest to understand; I was having trouble explaining it.
If you have any inquiries, please let me know.

Note: I didn’t know if I should submit this in Bug Reports because I’m not entirely sure this is a bug or my own error.

5 Likes

Hey man, why don’t you just make a send button, you see like when you click to send a message on a mobile application, and this button does your system that was on the “B” / “Done” on the console keyboard

I already considered this, and it’s not something you should have to do. As the developer, my goal is to make your experience as simple as possible.
I’m not sure if this is a bug or not, but if it isn’t and there’s no way to fix it, then I’ll do that, albeit begrudgingly.

dude, it’s not just another little button that will make things more complicated; on the contrary, it would be simpler and more visual. but hey, do as you want.

I’m aware it doesn’t make it more complicated. However, it’s quite annoying (from a console perspective) to have to send a message because the console “cursor” is quite slow to navigate, and it would take a lot more time to send than using the console navigation.