From 73ecbeb775d9d4db72d20e80fbab1ed642259594 Mon Sep 17 00:00:00 2001 From: "Derek J. Clark" Date: Thu, 8 May 2025 14:11:18 -0700 Subject: [PATCH] feat(Input Devices): Add updated target devices - Adds Horipad Steam Controller as a new additional target. - Switch to using deck-uhid target over the deck-vchi target --- core/global/launch_manager.gd | 2 +- core/systems/input/input_plumber.gd | 2 +- core/systems/input/input_plumber_profile.gd | 14 ++++++++++---- core/ui/card_ui/gamepad/gamepad_settings.gd | 14 +++++++++----- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/core/global/launch_manager.gd b/core/global/launch_manager.gd index d753d43c..dbd743b3 100644 --- a/core/global/launch_manager.gd +++ b/core/global/launch_manager.gd @@ -416,7 +416,7 @@ func set_gamepad_profile(path: String, target_gamepad: String = "") -> void: if not target_gamepad.is_empty(): var target_devices := PackedStringArray([target_gamepad, "keyboard", "mouse"]) match target_gamepad: - "xb360", "xbox-series", "xbox-elite", "gamepad": + "xb360", "xbox-series", "xbox-elite", "gamepad", "hori-steam": target_devices.append("touchpad") _: logger.debug(target_gamepad, "needs no additional target devices.") diff --git a/core/systems/input/input_plumber.gd b/core/systems/input/input_plumber.gd index 446a1a62..afb8593c 100644 --- a/core/systems/input/input_plumber.gd +++ b/core/systems/input/input_plumber.gd @@ -87,7 +87,7 @@ static func load_target_modified_profile(device: CompositeDevice, path: String, var mapped_capabilities := profile.to_json() logger.debug("Mapped Capabilities (before):", mapped_capabilities) match profile_modifier: - "deck": + "deck-uhid": logger.debug("Steam Deck Profile") if c_pad_cap not in mapped_capabilities: logger.debug("Map", c_pad_cap) diff --git a/core/systems/input/input_plumber_profile.gd b/core/systems/input/input_plumber_profile.gd index a03035d3..6237f311 100644 --- a/core/systems/input/input_plumber_profile.gd +++ b/core/systems/input/input_plumber_profile.gd @@ -12,6 +12,7 @@ enum TargetDevice { Keyboard, DualSense, DualSenseEdge, + Horipad, SteamDeck, XBox360, XBoxSeries, @@ -70,8 +71,10 @@ static func from_dict(dict: Dictionary) -> InputPlumberProfile: target_device = TargetDevice.DualSense "ds5-edge": target_device = TargetDevice.DualSenseEdge - "deck": + "deck-uhid": target_device = TargetDevice.SteamDeck + "hori-steam": + target_device = TargetDevice.Horipad "xb360": target_device = TargetDevice.XBox360 "xbox-series": @@ -112,8 +115,10 @@ static func get_target_device_string(target_device: TargetDevice) -> String: target_device_str = "ds5" TargetDevice.DualSenseEdge: target_device_str = "ds5-edge" + TargetDevice.Horipad: + target_device_str = "hori-steam" TargetDevice.SteamDeck: - target_device_str = "deck" + target_device_str = "deck-uhid" TargetDevice.XBox360: target_device_str = "xb360" TargetDevice.XBoxSeries: @@ -135,8 +140,10 @@ static func get_target_device(target_device_str: String) -> TargetDevice: target_device = TargetDevice.DualSense "ds5-edge": target_device = TargetDevice.DualSenseEdge - "deck": + "deck-uhid": target_device = TargetDevice.SteamDeck + "hori-steam": + target_device = TargetDevice.Horipad "xb360": target_device = TargetDevice.XBox360 "xbox-elite": @@ -228,4 +235,3 @@ func to_dict() -> Dictionary: func to_json() -> String: var dict := self.to_dict() return JSON.stringify(dict) - diff --git a/core/ui/card_ui/gamepad/gamepad_settings.gd b/core/ui/card_ui/gamepad/gamepad_settings.gd index bed2b5c0..bd8d50ad 100644 --- a/core/ui/card_ui/gamepad/gamepad_settings.gd +++ b/core/ui/card_ui/gamepad/gamepad_settings.gd @@ -22,8 +22,8 @@ var gamepad: CompositeDevice var profile: InputPlumberProfile var profile_gamepad: String var library_item: LibraryItem -var gamepad_types := ["Xbox 360", "XBox One Elite", "DualSense Edge", "Steam Deck (experimental)"] -var gamepad_types_icons := ["XBox 360", "Xbox One", "PS5", "Steam Deck"] #From res://assets/gamepad/icon_mappings +var gamepad_types := ["Xbox 360", "XBox One Elite", "DualSense Edge", "Steam Deck", "Horipad Steam Controller"] +var gamepad_types_icons := ["XBox 360", "Xbox One", "PS5", "Steam Deck", "Steam Deck"] #From res://assets/gamepad/icon_mappings var gamepad_type_selected := 0 var mapping_elements: Dictionary = {} var logger := Log.get_logger("GamepadSettings", Log.LEVEL.INFO) @@ -554,7 +554,9 @@ func get_selected_target_gamepad() -> InputPlumberProfile.TargetDevice: return InputPlumberProfile.TargetDevice.DualSenseEdge "DualSense Edge": return InputPlumberProfile.TargetDevice.DualSenseEdge - "Steam Deck (experimental)": + "Horipad Steam Controller": + return InputPlumberProfile.TargetDevice.Horipad + "Steam Deck": return InputPlumberProfile.TargetDevice.SteamDeck logger.error(selected_gamepad + " not found. Using XBox360") return InputPlumberProfile.TargetDevice.XBox360 @@ -573,8 +575,10 @@ func get_target_gamepad_text(gamepad_type: InputPlumberProfile.TargetDevice) -> return "DualSense" InputPlumberProfile.TargetDevice.DualSenseEdge: return "DualSense Edge" + InputPlumberProfile.TargetDevice.Horipad: + return "Horipad Steam Controller" InputPlumberProfile.TargetDevice.SteamDeck: - return "Steam Deck (experimental)" + return "Steam Deck" InputPlumberProfile.TargetDevice.XBox360: return "XBox 360" InputPlumberProfile.TargetDevice.XBoxSeries: @@ -610,7 +614,7 @@ func _set_gamepad_profile(gamepad: CompositeDevice, profile_path: String = "") - if not self.profile_gamepad.is_empty(): var target_devices := PackedStringArray([self.profile_gamepad, "keyboard", "mouse"]) match self.profile_gamepad: - "xb360", "xbox-series", "xbox-elite", "gamepad": + "xb360", "xbox-series", "xbox-elite", "gamepad", "hori-steam": target_devices.append("touchpad") _: logger.debug(self.profile_gamepad, "needs no additional target devices.")