Skip to content

feat(Input Devices): Add updated target devices #452

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/global/launch_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion core/systems/input/input_plumber.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 10 additions & 4 deletions core/systems/input/input_plumber_profile.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum TargetDevice {
Keyboard,
DualSense,
DualSenseEdge,
Horipad,
SteamDeck,
XBox360,
XBoxSeries,
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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:
Expand All @@ -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":
Expand Down Expand Up @@ -228,4 +235,3 @@ func to_dict() -> Dictionary:
func to_json() -> String:
var dict := self.to_dict()
return JSON.stringify(dict)

14 changes: 9 additions & 5 deletions core/ui/card_ui/gamepad/gamepad_settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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.")
Expand Down