GenericControllerInputConfig.cs
1 using Ryujinx.Common.Configuration.Hid.Controller.Motion; 2 using System; 3 using System.Text.Json.Serialization; 4 5 namespace Ryujinx.Common.Configuration.Hid.Controller 6 { 7 public class GenericControllerInputConfig<TButton, TStick> : GenericInputConfigurationCommon<TButton> where TButton : unmanaged where TStick : unmanaged 8 { 9 [JsonIgnore] 10 private float _deadzoneLeft; 11 [JsonIgnore] 12 private float _deadzoneRight; 13 [JsonIgnore] 14 private float _triggerThreshold; 15 16 /// <summary> 17 /// Left JoyCon Controller Stick Bindings 18 /// </summary> 19 public JoyconConfigControllerStick<TButton, TStick> LeftJoyconStick { get; set; } 20 21 /// <summary> 22 /// Right JoyCon Controller Stick Bindings 23 /// </summary> 24 public JoyconConfigControllerStick<TButton, TStick> RightJoyconStick { get; set; } 25 26 /// <summary> 27 /// Controller Left Analog Stick Deadzone 28 /// </summary> 29 public float DeadzoneLeft 30 { 31 get => _deadzoneLeft; set 32 { 33 _deadzoneLeft = MathF.Round(value, 3); 34 OnPropertyChanged(); 35 } 36 } 37 38 /// <summary> 39 /// Controller Right Analog Stick Deadzone 40 /// </summary> 41 public float DeadzoneRight 42 { 43 get => _deadzoneRight; set 44 { 45 _deadzoneRight = MathF.Round(value, 3); 46 OnPropertyChanged(); 47 } 48 } 49 50 /// <summary> 51 /// Controller Left Analog Stick Range 52 /// </summary> 53 public float RangeLeft { get; set; } 54 55 /// <summary> 56 /// Controller Right Analog Stick Range 57 /// </summary> 58 public float RangeRight { get; set; } 59 60 /// <summary> 61 /// Controller Trigger Threshold 62 /// </summary> 63 public float TriggerThreshold 64 { 65 get => _triggerThreshold; set 66 { 67 _triggerThreshold = MathF.Round(value, 3); 68 OnPropertyChanged(); 69 } 70 } 71 72 /// <summary> 73 /// Controller Motion Settings 74 /// </summary> 75 public MotionConfigController Motion { get; set; } 76 77 /// <summary> 78 /// Controller Rumble Settings 79 /// </summary> 80 public RumbleConfigController Rumble { get; set; } 81 } 82 }