From 591d92fe51404a033259f1ac169a878ea7014783 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 20 Aug 2021 07:58:02 +1000 Subject: [PATCH] Use 1-based indexing for button/axis names of OpenTK gamepads (to match DirectInput) --- src/BizHawk.Bizware.OpenTK3/OTK_Gamepad.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Bizware.OpenTK3/OTK_Gamepad.cs b/src/BizHawk.Bizware.OpenTK3/OTK_Gamepad.cs index fec2b64ea1..e33894282d 100644 --- a/src/BizHawk.Bizware.OpenTK3/OTK_Gamepad.cs +++ b/src/BizHawk.Bizware.OpenTK3/OTK_Gamepad.cs @@ -45,7 +45,7 @@ namespace BizHawk.Bizware.OpenTK3 { var known = devices[index]; devices[index] = null; - Console.WriteLine(known is null ? $"Dropped gamepad X{index}/J{index}" : $"Dropped gamepad {known.InputNamePrefixShort}: was {known.MappingsDatabaseName}"); + Console.WriteLine(known is null ? $"Dropped gamepad X{index + 1}/J{index + 1}" : $"Dropped gamepad {known.InputNamePrefixShort}: was {known.MappingsDatabaseName}"); } if (!initialized) return; lock (_syncObj) @@ -145,7 +145,7 @@ namespace BizHawk.Bizware.OpenTK3 HapticsChannels = _gamePadCapabilities != null && _gamePadCapabilities.Value.HasLeftVibrationMotor && _gamePadCapabilities.Value.HasRightVibrationMotor ? new[] { "Left", "Right" } // two haptic motors : new[] { "Mono" }; // one or zero haptic motors -- in the latter case, pretend it's mono anyway as that doesn't seem to cause problems - InputNamePrefixShort = $"{(MappedGamePad ? "X" : "J")}{_deviceIndex}"; + InputNamePrefixShort = $"{(MappedGamePad ? "X" : "J")}{_deviceIndex + 1}"; InputNamePrefix = $"{InputNamePrefixShort} "; MappingsDatabaseName = $"{guid ?? Guid.Empty} {name}"; Update();