fix(portmaster): correct muOS controller mapping

This commit is contained in:
Alexander Sellite 2026-08-08 10:40:49 -04:00
parent 32088ed9a6
commit 037d6288d3
2 changed files with 22 additions and 19 deletions

View file

@ -13,19 +13,19 @@ const MAX_PROFILE_BYTES: int = 1024 * 1024
const CAPTURE_AXIS_THRESHOLD: float = 0.55 const CAPTURE_AXIS_THRESHOLD: float = 0.55
const CAPTURE_AXIS_RELEASE_THRESHOLD: float = 0.30 const CAPTURE_AXIS_RELEASE_THRESHOLD: float = 0.30
const ACTIVE_DEVICE_AXIS_THRESHOLD: float = 0.35 const ACTIVE_DEVICE_AXIS_THRESHOLD: float = 0.35
const MUOS_MAPPING_REVISION: String = "muos-v2" const MUOS_MAPPING_REVISION: String = "muos-v3"
const MUOS_CONTROLLER_NAMES: Array[String] = [ const MUOS_CONTROLLER_NAMES: Array[String] = [
"muOS-Keys", "muOS-Keys",
"Deeplay-keys", "Deeplay-keys",
] ]
const MUOS_MAPPING_BINDINGS: String = ( const MUOS_MAPPING_BINDINGS: String = (
"a:b2,b:b0,x:b1,y:b3," "a:b4,b:b3,x:b5,y:b6,"
+ "leftshoulder:b6,rightshoulder:b7," + "leftshoulder:b7,rightshoulder:b8,"
+ "lefttrigger:b8,righttrigger:b9," + "lefttrigger:b13,righttrigger:b14,"
+ "guide:b12,start:b11,back:b10," + "guide:b11,start:b10,back:b9,"
+ "dpup:h0.1,dpleft:h0.8,dpright:h0.2,dpdown:h0.4," + "dpup:h0.1,dpleft:h0.8,dpright:h0.2,dpdown:h0.4,"
+ "leftx:a0,lefty:a1,leftstick:b4," + "leftx:a0,lefty:a1,leftstick:b12,"
+ "rightx:a2,righty:a3,rightstick:b5,platform:Linux," + "rightx:a2,righty:a3,rightstick:b15,platform:Linux,"
) )
const ROLE_A: StringName = &"a" const ROLE_A: StringName = &"a"
const ROLE_B: StringName = &"b" const ROLE_B: StringName = &"b"

View file

@ -35,28 +35,31 @@ func _run() -> void:
func _validate_manager(manager: ControllerMappingManagerType) -> String: func _validate_manager(manager: ControllerMappingManagerType) -> String:
var muos_mapping: String = ( var muos_mapping: String = (
ControllerMappingManagerType.build_muos_controller_mapping( ControllerMappingManagerType.build_muos_controller_mapping(
"19004ca6010000000100000000010000", "19000000010000000100000000010000",
"muOS-Keys", "muOS-Keys",
) )
) )
for expected_binding: String in [ for expected_binding: String in [
"a:b2", "a:b4",
"b:b0", "b:b3",
"x:b1", "x:b5",
"y:b3", "y:b6",
"leftshoulder:b6", "leftshoulder:b7",
"rightshoulder:b7", "rightshoulder:b8",
"lefttrigger:b8", "lefttrigger:b13",
"righttrigger:b9", "righttrigger:b14",
"back:b10", "back:b9",
"start:b11", "start:b10",
"guide:b11",
"leftstick:b12",
"rightstick:b15",
"leftx:a0", "leftx:a0",
"righty:a3", "righty:a3",
]: ]:
if expected_binding not in muos_mapping: if expected_binding not in muos_mapping:
return "muOS compatibility mapping omitted " + expected_binding return "muOS compatibility mapping omitted " + expected_binding
if not muos_mapping.begins_with( if not muos_mapping.begins_with(
"19004ca6010000000100000000010000,muOS-Keys," "19000000010000000100000000010000,muOS-Keys,"
): ):
return "muOS compatibility mapping does not use the runtime guid" return "muOS compatibility mapping does not use the runtime guid"
if not ControllerMappingManagerType.is_muos_controller_name( if not ControllerMappingManagerType.is_muos_controller_name(