-
-
Notifications
You must be signed in to change notification settings - Fork 223
Ensure console keybind respects chat #1989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
7e99b4a
cd6ee8b
c5b277d
9f37e80
52936cd
da66f6d
ddec041
4afdda4
6281146
3bbc4d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer using
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing as the first comment: rename |
||
| local chatFocused = service.TextChatService and service.TextChatService.ChatInputBarConfiguration and service.TextChatService.ChatInputBarConfiguration.IsFocused or false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing as the second comment: use |
||
| 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 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming
textboxtotextboxFocusedfor clarity.There was a problem hiding this comment.
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