Пример #1
0
        public SpecActions(Options opt, string edit = "", int editindex = -1)
        {
            InitializeComponent();
            this.opt           = opt;
            lbHoldForBatt.Text = lbHoldForProg.Text = lbHoldFor.Text;
            lbSecsBatt.Text    = lbSecsBatt.Text = lbSecsBatt.Text;
            device             = opt.device;
            cBProfiles.Items.Add(Properties.Resources.noneProfile);
            cBProfiles.SelectedIndex     = 0;
            cBActions.SelectedIndex      = 0;
            cBPressRelease.SelectedIndex = 0;

            /*if (Environment.OSVersion.Version.Major >= 10)
             * {
             *  cBActions.Items.Add("Xbox Game DVR");
             *  cBTapDVR.SelectedIndex = 0;
             *  cBHoldDVR.SelectedIndex = 2;
             *  cBDTapDVR.SelectedIndex = 1;
             * }*/
            cBActions.Items[7] = Properties.Resources.MultiAction;
            foreach (object s in opt.root.lBProfiles.Items)
            {
                cBProfiles.Items.Add(s.ToString());
            }
            editIndex = editindex;
            if (edit != string.Empty)
            {
                oldprofilename = edit;
                tBName.Text    = edit;
                LoadAction();
                loadingAction = false;
            }

            advColorDialog                = new AdvancedColorDialog();
            advColorDialog.FullOpen       = true;
            advColorDialog.OnUpdateColor += new AdvancedColorDialog.ColorUpdateHandler(this.advColorDialog_OnUpdateColor);

            tp.SetToolTip(cBMacroScanCode, Properties.Resources.MacroScanCodeTip);
            tp.SetToolTip(cBMacroRunOnRelease, Properties.Resources.MacroRunOnReleaseTip);
            tp.SetToolTip(cBMacroRepeat, Properties.Resources.MacroRepeatTip);
            tp.SetToolTip(cBMacroSyncRun, Properties.Resources.MacroSynchronizedRunTip);
            tp.SetToolTip(cBMacroKeepKeyState, Properties.Resources.MacroKeepKeyStateTip);
        }
Пример #2
0
        public KBM360(int deviceNum, Options ooo, Button buton)
        {
            InitializeComponent();
            advColorDialog = new AdvancedColorDialog();
            this.advColorDialog.OnUpdateColor += new AdvancedColorDialog.ColorUpdateHandler(this.advColorDialog_OnUpdateColor);
            pnl360BgImage = (Bitmap)Properties.Resources._360_map.Clone();
            //pnl360Controls.BackgroundImage = null;
            //pnl360Controls.BackgroundImageLayout = ImageLayout.None;
            use360 = true;
            device = deviceNum;
            pnl360Controls.Paint -= pnl360Controls_Paint;
            if (Global.outDevTypeTemp[device] == OutContType.DS4)
            {
                use360 = false;
                InitDS4Panel();
                PopulateDS4StrAliases();
                pnl360Controls.Hide();
                pnlDS4Controls.Show();
            }

            ops    = ooo;
            button = buton;
            DS4ControlSettings dcs = Global.getDS4CSetting(device, button.Name);

            cBToggle.Checked   = dcs.keyType.HasFlag(DS4KeyType.Toggle);
            cBScanCode.Checked = dcs.keyType.HasFlag(DS4KeyType.ScanCode);
            oldSC       = cBScanCode.Location;
            defaultText = btnDefault.Text;
            if (button.Name.StartsWith("bnShift"))
            {
                Console.Write("shift");
                Text            = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(7));
                btnDefault.Text = Properties.Resources.FallBack;
            }
            else if (button.Name.StartsWith("bn"))
            {
                Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(2));
            }

            foreach (Control control in Controls)
            {
                if (control is Button)
                {
                    ((Button)control).Click += anybtn_Click;
                }
            }

            if (use360)
            {
                pnl360Controls.Paint -= pnl360Controls_Paint;
                foreach (Control control in pnl360Controls.Controls)
                {
                    if (control is Button)
                    {
                        ((Button)control).Click += anybtn_Click;
                    }
                }
            }
            else
            {
                foreach (Control control in pnlDS4Controls.Controls)
                {
                    if (control is Button)
                    {
                        ((Button)control).Click += anybtn_Click;
                    }
                }
            }

            if (button.Name.Contains("Touch") || button.Name.Contains("Swipe"))
            {
                btnMOUSEDOWN.Visible  = false;
                btnMOUSELEFT.Visible  = false;
                btnMOUSERIGHT.Visible = false;
                btnMOUSEUP.Visible    = false;
            }

            ActiveControl = lBMacroOn;
            guideText     = btnGuide.Text;
            btnGuide.Text = "";
            cBShiftButton.SelectedIndex = Global.GetDS4STrigger(device, button.Name);
            cBShiftButton.Items[26]     = ops.fingerOnTouchpadToolStripMenuItem.Text;
            rBRegular.Checked           = true;
            loading = false;
        }