From 21350227c622dac1e2904ec88b324f336ed8e770 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 30 Jul 2018 16:35:58 -0500 Subject: [PATCH] Added unchecked block for report generation --- DS4Windows/DS4Control/ControlService.cs | 35 ++++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index f4953f1..f20936c 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -624,25 +624,28 @@ namespace DS4Windows { Xbox360Buttons tempButtons = 0; - if (state.Share) tempButtons |= Xbox360Buttons.Back; - if (state.L3) tempButtons |= Xbox360Buttons.LeftThumb; - if (state.R3) tempButtons |= Xbox360Buttons.RightThumb; - if (state.Options) tempButtons |= Xbox360Buttons.Start; + unchecked + { + if (state.Share) tempButtons |= Xbox360Buttons.Back; + if (state.L3) tempButtons |= Xbox360Buttons.LeftThumb; + if (state.R3) tempButtons |= Xbox360Buttons.RightThumb; + if (state.Options) tempButtons |= Xbox360Buttons.Start; - if (state.DpadUp) tempButtons |= Xbox360Buttons.Up; - if (state.DpadRight) tempButtons |= Xbox360Buttons.Right; - if (state.DpadDown) tempButtons |= Xbox360Buttons.Down; - if (state.DpadLeft) tempButtons |= Xbox360Buttons.Left; + if (state.DpadUp) tempButtons |= Xbox360Buttons.Up; + if (state.DpadRight) tempButtons |= Xbox360Buttons.Right; + if (state.DpadDown) tempButtons |= Xbox360Buttons.Down; + if (state.DpadLeft) tempButtons |= Xbox360Buttons.Left; - if (state.L1) tempButtons |= Xbox360Buttons.LeftShoulder; - if (state.R1) tempButtons |= Xbox360Buttons.RightShoulder; + if (state.L1) tempButtons |= Xbox360Buttons.LeftShoulder; + if (state.R1) tempButtons |= Xbox360Buttons.RightShoulder; - if (state.Triangle) tempButtons |= Xbox360Buttons.Y; - if (state.Circle) tempButtons |= Xbox360Buttons.B; - if (state.Cross) tempButtons |= Xbox360Buttons.A; - if (state.Square) tempButtons |= Xbox360Buttons.X; - if (state.PS) tempButtons |= Xbox360Buttons.Guide; - xboxreport.SetButtons(tempButtons); + if (state.Triangle) tempButtons |= Xbox360Buttons.Y; + if (state.Circle) tempButtons |= Xbox360Buttons.B; + if (state.Cross) tempButtons |= Xbox360Buttons.A; + if (state.Square) tempButtons |= Xbox360Buttons.X; + if (state.PS) tempButtons |= Xbox360Buttons.Guide; + xboxreport.SetButtons(tempButtons); + } xboxreport.LeftTrigger = state.L2; xboxreport.RightTrigger = state.R2;