diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index 15cb363..3768602 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -839,131 +839,73 @@ namespace DS4Windows } } - public string GetInputkeys(int ind) + public DS4Controls GetActiveInputControl(int ind) { DS4State cState = CurrentState[ind]; DS4StateExposed eState = ExposedState[ind]; Mouse tp = touchPad[ind]; - string result = "nothing"; + DS4Controls result = DS4Controls.None; if (DS4Controllers[ind] != null) { if (Mapping.getBoolButtonMapping(cState.Cross)) - { - result = "Cross"; - } + result = DS4Controls.Cross; else if (Mapping.getBoolButtonMapping(cState.Circle)) - { - result = "Circle"; - } + result = DS4Controls.Circle; else if (Mapping.getBoolButtonMapping(cState.Triangle)) - { - result = "Triangle"; - } + result = DS4Controls.Triangle; else if (Mapping.getBoolButtonMapping(cState.Square)) - { - result = "Square"; - } + result = DS4Controls.Square; else if (Mapping.getBoolButtonMapping(cState.L1)) - { - result = "L1"; - } + result = DS4Controls.L1; else if (Mapping.getBoolTriggerMapping(cState.L2)) - { - result = "L2"; - } + result = DS4Controls.L2; else if (Mapping.getBoolButtonMapping(cState.L3)) - { - result = "L3"; - } + result = DS4Controls.L3; else if (Mapping.getBoolButtonMapping(cState.R1)) - { - result = "R1"; - } + result = DS4Controls.R1; else if (Mapping.getBoolTriggerMapping(cState.R2)) - { - result = "R2"; - } + result = DS4Controls.R2; else if (Mapping.getBoolButtonMapping(cState.R3)) - { - result = "R3"; - } + result = DS4Controls.R3; else if (Mapping.getBoolButtonMapping(cState.DpadUp)) - { - result = "Up"; - } + result = DS4Controls.DpadUp; else if (Mapping.getBoolButtonMapping(cState.DpadDown)) - { - result = "Down"; - } + result = DS4Controls.DpadDown; else if (Mapping.getBoolButtonMapping(cState.DpadLeft)) - { - result = "Left"; - } + result = DS4Controls.DpadLeft; else if (Mapping.getBoolButtonMapping(cState.DpadRight)) - { - result = "Right"; - } + result = DS4Controls.DpadRight; else if (Mapping.getBoolButtonMapping(cState.Share)) - { - result = "Share"; - } + result = DS4Controls.Share; else if (Mapping.getBoolButtonMapping(cState.Options)) - { - result = "Options"; - } + result = DS4Controls.Options; else if (Mapping.getBoolButtonMapping(cState.PS)) - { - result = "PS"; - } + result = DS4Controls.PS; else if (Mapping.getBoolAxisDirMapping(cState.LX, true)) - { - result = "LS Right"; - } + result = DS4Controls.LXPos; else if (Mapping.getBoolAxisDirMapping(cState.LX, false)) - { - result = "LS Left"; - } + result = DS4Controls.LXNeg; else if (Mapping.getBoolAxisDirMapping(cState.LY, true)) - { - result = "LS Down"; - } + result = DS4Controls.LYPos; else if (Mapping.getBoolAxisDirMapping(cState.LY, false)) - { - result = "LS Up"; - } + result = DS4Controls.LYNeg; else if (Mapping.getBoolAxisDirMapping(cState.RX, true)) - { - result = "RS Right"; - } + result = DS4Controls.RXPos; else if (Mapping.getBoolAxisDirMapping(cState.RX, false)) - { - result = "RS Left"; - } + result = DS4Controls.RXNeg; else if (Mapping.getBoolAxisDirMapping(cState.RY, true)) - { - result = "RS Down"; - } + result = DS4Controls.RYPos; else if (Mapping.getBoolAxisDirMapping(cState.RY, false)) - { - result = "RS Up"; - } + result = DS4Controls.RYNeg; else if (Mapping.getBoolTouchMapping(tp.leftDown)) - { - result = "Touch Left"; - } + result = DS4Controls.TouchLeft; else if (Mapping.getBoolTouchMapping(tp.rightDown)) - { - result = "Touch Right"; - } + result = DS4Controls.TouchRight; else if (Mapping.getBoolTouchMapping(tp.multiDown)) - { - result = "Touch Multi"; - } + result = DS4Controls.TouchMulti; else if (Mapping.getBoolTouchMapping(tp.upperDown)) - { - result = "Touch Upper"; - } + result = DS4Controls.TouchUpper; } return result; diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index d26e11f..11bc737 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -1053,42 +1053,38 @@ namespace DS4Windows if (Form.ActiveForm == root && cBControllerInput.Checked && tCControls.SelectedIndex < 1) { int tempDeviceNum = (int)nUDSixaxis.Value - 1; - switch (Program.rootHub.GetInputkeys(tempDeviceNum)) + switch (Program.rootHub.GetActiveInputControl(tempDeviceNum)) { - case ("nothing"): break; - case ("Cross"): Show_ControlsBn(bnCross, e); break; - case ("Circle"): Show_ControlsBn(bnCircle, e); break; - case ("Square"): Show_ControlsBn(bnSquare, e); break; - case ("Triangle"): Show_ControlsBn(bnTriangle, e); break; - case ("Options"): Show_ControlsBn(bnOptions, e); break; - case ("Share"): Show_ControlsBn(bnShare, e); break; - case ("Up"): Show_ControlsBn(bnUp, e); break; - case ("Down"): Show_ControlsBn(bnDown, e); break; - case ("Left"): Show_ControlsBn(bnLeft, e); break; - case ("Right"): Show_ControlsBn(bnRight, e); break; - case ("PS"): Show_ControlsBn(bnPS, e); break; - case ("L1"): Show_ControlsBn(bnL1, e); break; - case ("R1"): Show_ControlsBn(bnR1, e); break; - case ("L2"): Show_ControlsBn(bnL2, e); break; - case ("R2"): Show_ControlsBn(bnR2, e); break; - case ("L3"): Show_ControlsBn(bnL3, e); break; - case ("R3"): Show_ControlsBn(bnR3, e); break; - case ("Touch Left"): Show_ControlsBn(bnTouchLeft, e); break; - case ("Touch Right"): Show_ControlsBn(bnTouchRight, e); break; - case ("Touch Multi"): Show_ControlsBn(bnTouchMulti, e); break; - case ("Touch Upper"): Show_ControlsBn(bnTouchUpper, e); break; - case ("LS Up"): Show_ControlsBn(bnLSUp, e); break; - case ("LS Down"): Show_ControlsBn(bnLSDown, e); break; - case ("LS Left"): Show_ControlsBn(bnLSLeft, e); break; - case ("LS Right"): Show_ControlsBn(bnLSRight, e); break; - case ("RS Up"): Show_ControlsBn(bnRSUp, e); break; - case ("RS Down"): Show_ControlsBn(bnRSDown, e); break; - case ("RS Left"): Show_ControlsBn(bnRSLeft, e); break; - case ("RS Right"): Show_ControlsBn(bnRSRight, e); break; - case ("GyroXP"): Show_ControlsBn(bnGyroXP, e); break; - case ("GyroXN"): Show_ControlsBn(bnGyroXN, e); break; - case ("GyroZP"): Show_ControlsBn(bnGyroZP, e); break; - case ("GyroZN"): Show_ControlsBn(bnGyroZN, e); break; + case DS4Controls.None: break; + case DS4Controls.Cross: Show_ControlsBn(bnCross, e); break; + case DS4Controls.Circle: Show_ControlsBn(bnCircle, e); break; + case DS4Controls.Square: Show_ControlsBn(bnSquare, e); break; + case DS4Controls.Triangle: Show_ControlsBn(bnTriangle, e); break; + case DS4Controls.Options: Show_ControlsBn(bnOptions, e); break; + case DS4Controls.Share: Show_ControlsBn(bnShare, e); break; + case DS4Controls.DpadUp: Show_ControlsBn(bnUp, e); break; + case DS4Controls.DpadDown: Show_ControlsBn(bnDown, e); break; + case DS4Controls.DpadLeft: Show_ControlsBn(bnLeft, e); break; + case DS4Controls.DpadRight: Show_ControlsBn(bnRight, e); break; + case DS4Controls.PS: Show_ControlsBn(bnPS, e); break; + case DS4Controls.L1: Show_ControlsBn(bnL1, e); break; + case DS4Controls.R1: Show_ControlsBn(bnR1, e); break; + case DS4Controls.L2: Show_ControlsBn(bnL2, e); break; + case DS4Controls.R2: Show_ControlsBn(bnR2, e); break; + case DS4Controls.L3: Show_ControlsBn(bnL3, e); break; + case DS4Controls.R3: Show_ControlsBn(bnR3, e); break; + case DS4Controls.TouchLeft: Show_ControlsBn(bnTouchLeft, e); break; + case DS4Controls.TouchRight: Show_ControlsBn(bnTouchRight, e); break; + case DS4Controls.TouchMulti: Show_ControlsBn(bnTouchMulti, e); break; + case DS4Controls.TouchUpper: Show_ControlsBn(bnTouchUpper, e); break; + case DS4Controls.LYNeg: Show_ControlsBn(bnLSUp, e); break; + case DS4Controls.LYPos: Show_ControlsBn(bnLSDown, e); break; + case DS4Controls.LXNeg: Show_ControlsBn(bnLSLeft, e); break; + case DS4Controls.LXPos: Show_ControlsBn(bnLSRight, e); break; + case DS4Controls.RYNeg: Show_ControlsBn(bnRSUp, e); break; + case DS4Controls.RYPos: Show_ControlsBn(bnRSDown, e); break; + case DS4Controls.RXNeg: Show_ControlsBn(bnRSLeft, e); break; + case DS4Controls.RXPos: Show_ControlsBn(bnRSRight, e); break; default: break; } }