예제 #1
0
        public DeviceMapping Clone()
        {
            var dm = new DeviceMapping();

            dm.Pad         = Pad;
            dm.Source      = Source;
            dm.Gesture     = Gesture;
            dm.Destination = Destination;
            return(dm);
        }
예제 #2
0
        private void axisPressed(object sender, EventArgs e)
        {
            if (remainingBtnSpots.Count > 0)
                return;
            if (remainingAxisSpots.Count == 0)
                return;

            pbar.Value += 1;

            var spot = remainingAxisSpots[0];
            remainingAxisSpots.RemoveAt(0);

            if (sender != null) {
                var aa = sender as AxisActions;
                int id = (int)aa.Identifier;

                var dm = new DeviceMapping();
                dm.Source = "axis:" + (id - 1);
                dm.Destination = spot.Axis.ToString();
                dm.Gesture = "";
                mappings.Add(dm);
                progress.Text += string.Format("- Mapped axis #{0} to {1}", id - 1, Util.GetAxisDisplayName(spot.Axis)) + "\n";
            } else {
                progress.Text += string.Format("- Not mapping axis {0}", Util.GetAxisDisplayName(spot.Axis)) + "\n";
            }

            if (spot.Axis == VirtualController.Axis.Trigger){
                front.Show();
                top.Hide();
            }

            if (remainingAxisSpots.Count == 0) {
                page3.BringToFront();
                startBtn.Enabled = true;
                noHaveBtn.Enabled = false;
                finishedLbl.Text = finishedLbl.Text.Replace("%", Controller.Device.ProductName);
                sendPermission.Text = sendPermission.Text.Replace("%", Controller.Device.ProductName);
                pbar.Hide();
            } else {
                spot = remainingAxisSpots[0];
                indicator.Location = new Point(front.Left + spot.X - 3, front.Top + spot.Y - 3);
            }
        }
예제 #3
0
파일: Config.cs 프로젝트: Bradsama/padtie
 public DeviceMapping Clone()
 {
     var dm = new DeviceMapping();
     dm.Pad = Pad;
     dm.Source = Source;
     dm.Gesture = Gesture;
     dm.Destination = Destination;
     return dm;
 }
예제 #4
0
 public DeviceMappingItem(DeviceMapping dm)
 {
     Mapping = dm;
 }
예제 #5
0
        private void buttonPressed(object sender, EventArgs e)
        {
            if (remainingBtnSpots.Count == 0)
                return;

            pbar.Value += 1;

            var spot = remainingBtnSpots[0];
            remainingBtnSpots.RemoveAt(0);

            if (sender != null) {
                var ba = sender as ButtonActions;
                int id = (int)ba.Identifier;

                var dm = new DeviceMapping();
                dm.Source = "button:" + (id - 1);
                dm.Gesture = "Link";
                dm.Destination = spot.Button.ToString();
                mappings.Add(dm);
                progress.Text += string.Format("- Mapped button {0} to {1}", id - 1, Util.GetButtonDisplayName(spot.Button)) + "\n";
            } else {
                progress.Text += string.Format("- Not mapping button {0}", Util.GetButtonDisplayName(spot.Button)) + "\n";
            }

            if (spot.Button == VirtualController.Button.Tr) {
                front.Show();
                top.Hide();
            }

            if (remainingBtnSpots.Count == 0) {
                front.Hide();
                top.Show();
                var aspot = remainingAxisSpots[0];
                indicator.Location = new Point(front.Left + aspot.X - 8, front.Top + aspot.Y - 10);
                return;
            } else {
                int xadd = 0, yadd = 0;

                if (front.Visible) {
                    xadd = -3;
                    yadd = -3;
                }

                spot = remainingBtnSpots[0];
                indicator.Location = new Point(front.Left + spot.X + xadd, front.Top + spot.Y + yadd);
            }
        }