Skip to content
Closed
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Aero/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,9 @@ return function(data, env)
end)

BindEvent(service.UserInputService.InputBegan, function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming textbox to textboxFocused for clarity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do that. VSC can probably search and replace

local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer using service.TextChatService:FindFirstChildOfClass("ChatInputBarConfiguration") to get the ChatInputBarConfiguration instance. ChatInputBarConfiguration is not a property of TextChatService, but rather a child instance under TextChatService.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it can be renamed

if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
7 changes: 4 additions & 3 deletions MainModule/Client/UI/Aero/PlayerList.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,10 @@ return function(data, env)
fadeOut()
end)

service.UserInputService.InputBegan:Connect(function(InputObject)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Tab then
service.UserInputService.InputBegan:Connect(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as the first comment: rename textbox to textboxFocused.

local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as the second comment: use :FindFirstChildOfClass() to get the ChatInputBarConfiguration.

if not textbox and not chatFocused and not gameProcessedEvent and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Tab then
if drag.Visible then
drag.Visible = false
else
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Default/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,9 @@ return function(data, env)
end)

gTable.BindEvent(service.UserInputService.InputBegan, function(inputObject: InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(inputObject.UserInputType, Enum.UserInputType.Keyboard) and inputObject.KeyCode.Name == (Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider applying the same changes suggested in the first and second comments, for the rest of the files.
(Yeah, it's kinda sad how adonis has lots and lots of duplicated code across the UI themes. We should fix this someday.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Fix someday = until roblox inevitably breaks it or someone comes up with a genius solution at 1AM)

local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(inputObject.UserInputType, Enum.UserInputType.Keyboard) and inputObject.KeyCode.Name == (Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
7 changes: 4 additions & 3 deletions MainModule/Client/UI/Default/PlayerList.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,10 @@ return function(data, env)
fadeOut()
end)

service.UserInputService.InputBegan:Connect(function(InputObject)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Tab then
service.UserInputService.InputBegan:Connect(function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Tab then
if drag.Visible then
drag.Visible = false
else
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Default/Settings.luau
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ return function(data, env)
local gotKey, visualName
toggle.Text = "Waiting..."
local event = service.UserInputService.InputBegan:Connect(function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
gotKey, visualName = InputObject.KeyCode.Name, Functions.KeyCodeToName(InputObject.KeyCode.Value)
end
end)
Expand Down
10 changes: 6 additions & 4 deletions MainModule/Client/UI/Default/UserPanel.luau
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,9 @@ return function(data, env)
button.Text = "Waiting..."
Variables.WaitingForBind = true
keyInputHandler = window:BindEvent(service.UserInputService.InputBegan, function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and not gameProcessedEvent and not doneKey and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and not doneKey and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
currentKey = InputObject.KeyCode
if currentKey then
button.Text = string.upper(keyCodeToName(currentKey.Value))
Expand Down Expand Up @@ -1512,8 +1513,9 @@ return function(data, env)
local gotKey, visualName
toggle.Text = "Waiting..."
local event = service.UserInputService.InputBegan:Connect(function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
gotKey, visualName = InputObject.KeyCode.Name, Functions.KeyCodeToName(InputObject.KeyCode.Value)
end
end)
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Rounded/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ return function(data, env)
end)

BindEvent(service.UserInputService.InputBegan, function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Steampunk/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ return function(data, env)
end)

gTable.BindEvent(service.UserInputService.InputBegan, function(inputObject: InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(inputObject.UserInputType, Enum.UserInputType.Keyboard) and inputObject.KeyCode.Name == (Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(inputObject.UserInputType, Enum.UserInputType.Keyboard) and inputObject.KeyCode.Name == (Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Unity/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,9 @@ return function(data, env)
end)

BindEvent(service.UserInputService.InputBegan, function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
5 changes: 3 additions & 2 deletions MainModule/Client/UI/Windows XP/Console.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,9 @@ return function(data, env)
end)

BindEvent(service.UserInputService.InputBegan, function(InputObject, gameProcessedEvent)
local textbox = service.UserInputService:GetFocusedTextBox()
if not textbox and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
local textbox = service.UserInputService:GetFocusedTextBox() ~= nil
local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false
if not textbox and not chatFocused and not gameProcessedEvent and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
Expand Down
Loading