From 6812729237a1c8a70b5e1045055c726cc2a366a4 Mon Sep 17 00:00:00 2001 From: Takoz Date: Thu, 5 Nov 2026 19:32:17 +0100 Subject: [PATCH 1/2] Simplify gamepad input handling --- src/Features/Gamepad.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Features/Gamepad.lua b/src/Features/Gamepad.lua index aba4cbb..61b513a 100644 --- a/src/Features/Gamepad.lua +++ b/src/Features/Gamepad.lua @@ -147,7 +147,7 @@ function Gamepad.getIconToHighlight() local thisX = icon.widget.AbsolutePosition.X if not currentX or thisX < currentX then iconToHighlight = icon - currentX = iconToHighlight.widget.AbsolutePosition.X + currentX = thisX end end end @@ -180,13 +180,12 @@ function Gamepad.registerButton(buttonInstance) return end local isSelected = GuiService.SelectedObject == buttonInstance - local unselectKeyCodes = {"ButtonB", "ButtonSelect"} - local keyName = input.KeyCode.Name - if table.find(unselectKeyCodes, keyName) and isSelected then + local keyCode = input.KeyCode + if (keyCode == Enum.KeyCode.ButtonB or keyCode == Enum.KeyCode.ButtonSelect) and isSelected then -- We unfocus when back button is pressed, but ignore -- if the virtual cursor is disabled otherwise it will be -- impossible to select the topbar - if not(keyName == "ButtonSelect" and not GamepadService.GamepadCursorEnabled) then + if not (keyCode == Enum.KeyCode.ButtonSelect and not GamepadService.GamepadCursorEnabled) then GuiService.SelectedObject = nil end end From 1157448b3b31a62dd43ff09fa1aba45dd9805320 Mon Sep 17 00:00:00 2001 From: Takoz Date: Thu, 5 Nov 2026 19:46:56 +0100 Subject: [PATCH 2/2] Fix spelling mistake in comments --- src/Features/Gamepad.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Features/Gamepad.lua b/src/Features/Gamepad.lua index 61b513a..db14001 100644 --- a/src/Features/Gamepad.lua +++ b/src/Features/Gamepad.lua @@ -1,7 +1,7 @@ -- As the name suggests, this handles everything related to gamepads -- (i.e. Xbox or Playstation controllers) and their navigation -- I created a separate module for gamepads (and not touchpads or --- keyboards) because gamepads are greatly more unqiue and require +-- keyboards) because gamepads are greatly more unique and require -- additional tailored programming @@ -104,7 +104,7 @@ function Gamepad.start(incomingIcon) preferredInputChanged() -- This allows for easy highlighting of the topbar when the - -- when ``Icon.highlightKey`` (i.e. DPadUp) is pressed. + -- ``Icon.highlightKey`` (i.e. DPadUp) is pressed. -- If you'd like to disable, do ``Icon.highlightKey = false`` UserInputService.InputBegan:Connect(function(input, touchingAnObject) if input.UserInputType == Enum.UserInputType.MouseButton1 then