Adonis icon indicating copy to clipboard operation
Adonis copied to clipboard

Ensure console keybind respects chat

Open totallytavi opened this issue 3 months ago • 9 comments

Roblox has recently introduced a change that results in ContextActionService ignoring chat inputs. CoreGui is made nil, so CAS won't properly detect that the events are game processed events.

See this DevForum thread: https://devforum.roblox.com/t/userinputservicegetfocusedtextbox-returns-nil-with-the-chat-box-focused/3940424

Minimum reproducible example

Since CodeRabbit is so angry I didn't do this.

local UserInputService = game:GetService("UserInputService")
local TextChatService = game:GetService("TextChatService")

UserInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
	if input.KeyCode ~= Enum.KeyCode.Quote then
		return
	end
	
	print(
		'Quote key processed',
		gameProcessedEvent and "GPE" or "Non-GPE",
		TextChatService.ChatInputBarConfiguration.IsFocused and "Focused" or "Not-Focused",
                UserInputService:GetFocusedTextBox() and "Textbox" or "No-Textbox"
	)
end)
image

Summary by CodeRabbit

  • Bug Fixes
    • Improved keyboard input handling across UI themes: console toggle and key-driven panels now ignore input when chat or text boxes are focused, preventing unintended toggles.
    • Tab and other key interactions for player list, settings, and user panel now respect chat input focus and game-processed events for more reliable behavior.

totallytavi avatar Sep 19 '25 20:09 totallytavi

https://github.com/Epix-Incorporated/Adonis/blob/2d505fed09b7c5eb9fe863bd601bafaa957c63f7/MainModule/Client/UI/Default/Settings.luau#L117 https://github.com/Epix-Incorporated/Adonis/blob/2d505fed09b7c5eb9fe863bd601bafaa957c63f7/MainModule/Client/UI/Aero/PlayerList.rbxmx#L361 https://github.com/Epix-Incorporated/Adonis/blob/2d505fed09b7c5eb9fe863bd601bafaa957c63f7/MainModule/Client/UI/Default/UserPanel.luau#L1056 https://github.com/Epix-Incorporated/Adonis/blob/2d505fed09b7c5eb9fe863bd601bafaa957c63f7/MainModule/Client/UI/Default/PlayerList.rbxmx#L346

ari-party avatar Sep 22 '25 16:09 ari-party

Thanks for pointing out the ones I missed @ari-party. I'll submit some more fixes for this later

totallytavi avatar Sep 22 '25 18:09 totallytavi

Wasn't this already fixed by simply checking gameProcessedEvent? https://github.com/Epix-Incorporated/Adonis/pull/1984

GalacticInspired avatar Oct 04 '25 23:10 GalacticInspired

Potentially, let me see.

totallytavi avatar Oct 07 '25 16:10 totallytavi

Potentially, let me see.

Hi, have you managed to check this out yet?

GalacticInspired avatar Oct 13 '25 12:10 GalacticInspired

I opened a baseplate and had a weird issue with Adonis. I'll see if I can make a reproducible example

totallytavi avatar Oct 15 '25 18:10 totallytavi

@GalacticInspired Seems to fix it, since Roblox will mark the event as a gameProcessedEvent. I don't trust that Roblox will keep this so just for safety, I'll implement both GPE and IsFocused in my PR image

local UserInputService = game:GetService("UserInputService")
local TextChatService = game:GetService("TextChatService")

UserInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
	if input.KeyCode ~= Enum.KeyCode.Quote then
		return
	end
	
	print(
		'Quote key processed',
		gameProcessedEvent and "GPE" or "Non-GPE",
		TextChatService.ChatInputBarConfiguration.IsFocused and "Focused" or "Not-Focused"
	)
end)

totallytavi avatar Oct 22 '25 16:10 totallytavi

As @ari-party pointed out, #1984 didn't account for a few other UIs so I'll drop that into my PR as well

totallytavi avatar Oct 22 '25 16:10 totallytavi

Please submit this PR again once requested changes have been made.

GalacticInspired avatar Dec 18 '25 13:12 GalacticInspired