Ejemplo n.º 1
0
        public MapPointerForm(PadTieForm main, Controller cc, MousePointerAction editing)
            : this(main, cc)
        {
            this.editing = editing;
            motionX.Text = editing.X.ToString();
            motionY.Text = editing.Y.ToString();
            continuous.Checked = editing.Continuous;
            useIntensity.Checked = editing.UseIntensity;

            slotCapture.SetInput(editing.SlotDescription, true);
        }
Ejemplo n.º 2
0
        public static MousePointerAction Parse(InputCore core, string parseable)
        {
            string[] parts = parseable.Split(',');

            var mpa = new MousePointerAction(core, int.Parse(parts[0]), int.Parse(parts[1]));

            if (parts.Length > 2) {
                mpa.Continuous = bool.Parse(parts[2]);
                mpa.UseIntensity = bool.Parse(parts[3]);
            }

            return mpa;
        }
Ejemplo n.º 3
0
        private void okBtn_Click(object sender, EventArgs e)
        {
            int x, y;

            try {
                x = int.Parse(motionX.Text);
                y = int.Parse(motionY.Text);
            } catch (Exception) {
                MessageBox.Show("The X/Y coordinates must be positive or negative whole numbers.");
                return;
            }

            if (slotCapture.Value == null) {
                MessageBox.Show("Please click Capture and press a button or axis direction on the gamepad.");
                return;
            }

            var input = slotCapture.Value;
            MousePointerAction action;

            if (editing == null) {
                action = new MousePointerAction(Controller.Core, x, y);
            } else {
                action = editing;
                action.X = x;
                action.Y = y;
                if (action.SlotDescription != input)
                    MapUtil.Map(MainForm, Controller.Virtual, action.SlotDescription, null);
            }

            action.Continuous = continuous.Checked;
            action.UseIntensity = useIntensity.Checked;

            MapUtil.Map(MainForm, Controller.Virtual, input, action);

            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }