示例#1
0
        private void SetXInputDeviceStatus(ScpDirector.XInput_Device device)
        {
            string status = Globalization.Translate("Status_Disconnected");

            if (ScpDirector.Access.IsConnected(device))
            {
                status = Globalization.Translate("Status_Connected");
            }

            status = Globalization.TranslateFormat("XInput_Device_Num", (int)device, status);

            switch (device)
            {
            case ScpDirector.XInput_Device.Device_A:
                xlabel1.Content = status;
                break;

            case ScpDirector.XInput_Device.Device_B:
                xlabel2.Content = status;
                break;

            case ScpDirector.XInput_Device.Device_C:
                xlabel3.Content = status;
                break;

            case ScpDirector.XInput_Device.Device_D:
                xlabel4.Content = status;
                break;
            }
        }
 public XInputAxisAssignment(X360Axis axis, ScpDirector.XInput_Device device = ScpDirector.XInput_Device.Device_A)
 {
     Axis   = axis;
     Device = device;
 }
示例#3
0
 public XInputButtonAssignment(X360Button button, ScpDirector.XInput_Device device = ScpDirector.XInput_Device.Device_A)
 {
     Button = button;
     Device = device;
 }
示例#4
0
        public void XboxAssign(ScpDirector.XInput_Device device = ScpDirector.XInput_Device.Device_A)
        {
            Dictionary <string, AssignmentCollection> defaults = new Dictionary <string, AssignmentCollection>();

            // Depends on what extension is connected
            // IR
            //defaults.Add(INPUT_NAMES.WIIMOTE.UP,    new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.RY_Hi, device) }));
            //defaults.Add(INPUT_NAMES.WIIMOTE.RDOWN,  new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.RY_Lo, device) }));
            //defaults.Add(INPUT_NAMES.WIIMOTE.RRIGHT, new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.RX_Hi, device) }));
            //defaults.Add(INPUT_NAMES.WIIMOTE.RLEFT,  new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.RX_Lo, device) }));

            defaults.Add(INPUT_NAMES.WIIMOTE.UP, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Up, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.DOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Down, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.LEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Left, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.RIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Right, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.A, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.A, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.B, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.B, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.MINUS, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Start, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.PLUS, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Back, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.HOME, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Guide, device)
            }));

            defaults.Add(INPUT_NAMES.NUNCHUK.UP, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.NUNCHUK.DOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.NUNCHUK.RIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.NUNCHUK.LEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Lo, device)
            }));

            defaults.Add(INPUT_NAMES.WIIMOTE.ONE, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.X, device)
            }));
            defaults.Add(INPUT_NAMES.WIIMOTE.TWO, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Y, device)
            }));
            defaults.Add(INPUT_NAMES.NUNCHUK.C, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.LB, device)
            }));
            defaults.Add(INPUT_NAMES.NUNCHUK.Z, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.RB, device)
            }));
            //defaults.Add(INPUT_NAMES.NUNCHUK.ZL,     new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.LT, device) }));
            //defaults.Add(INPUT_NAMES.NUNCHUK.ZR,     new AssignmentCollection(new List<IAssignment> { new XInputAxisAssignment(ScpControl.X360Axis.RT, device) }));
            //defaults.Add(INPUT_NAMES.WIIMOTE.LS,     new AssignmentCollection(new List<IAssignment> { new XInputButtonAssignment(ScpControl.X360Button.LS, device) }));
            //defaults.Add(INPUT_NAMES.WIIMOTE.RS,     new AssignmentCollection(new List<IAssignment> { new XInputButtonAssignment(ScpControl.X360Button.RS, device) }));

            #region Classic Controller
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LUP, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LDOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LRIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LLEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RUP, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RY_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RDOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RY_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RRIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RX_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RLEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RX_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LT, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RT, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.UP, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Up, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.DOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Down, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Left, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Right, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.A, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.A, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.B, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.B, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.X, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.X, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.Y, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Y, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.ZL, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.LB, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.ZR, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.RB, device)
            }));
            //defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.LFULL,  new AssignmentCollection(new List<IAssignment> { new XInputButtonAssignment(ScpControl.X360Button.LS, device) }));
            //defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.RFULL,  new AssignmentCollection(new List<IAssignment> { new XInputButtonAssignment(ScpControl.X360Button.RS, device) }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.START, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Start, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.SELECT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Back, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER.HOME, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Guide, device)
            }));
            #endregion

            #region Classic Controller Pro
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LUP, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LDOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LY_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LRIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LLEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LX_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RUP, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RY_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RDOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RY_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RRIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RX_Hi, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RLEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RX_Lo, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZL, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.LT, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.ZR, new AssignmentCollection(new List <IAssignment> {
                new XInputAxisAssignment(ScpControl.X360Axis.RT, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.UP, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Up, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.DOWN, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Down, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.LEFT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Left, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.RIGHT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Right, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.A, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.A, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.B, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.B, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.X, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.X, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.Y, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Y, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.L, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.LB, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.R, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.RB, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.START, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Start, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.SELECT, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Back, device)
            }));
            defaults.Add(INPUT_NAMES.CLASSIC_CONTROLLER_PRO.HOME, new AssignmentCollection(new List <IAssignment> {
                new XInputButtonAssignment(ScpControl.X360Button.Guide, device)
            }));
            #endregion

            CallEvent_OnQuickAssign(defaults);
        }