Ejemplo n.º 1
0
 private void KeyDownUpProcess(KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.Escape:
     {
         //isDragging = !isDragging;
         if (CoordinateTimer.Enabled)
         {
             CoordinateTimer.Stop();
         }
         else
         {
             CoordinateTimer.Start();
         }
         if (cursorhidden)
         {
             Cursor.Show();
             cursorhidden = false;
         }
         else
         {
             Cursor.Hide();
             cursorhidden = true;
         }
         fireOK           = false;
         redDot.BackColor = Color.Yellow;
         break;
     }
     }
 }
Ejemplo n.º 2
0
        private void FPSAim_FormClosing(object sender, FormClosingEventArgs e)
        {
            CoordinateTimer.Stop();
            CloseVideoSource();
            Cursor.Show();

            Packet packet = new Packet(servos.CenterServosPosition);

            packet.setFireOff();
            sendData(packet);
        }
Ejemplo n.º 3
0
        private void redDot_MouseUp(object sender, MouseEventArgs e)
        {
            CoordinateTimer.Stop();
            isDragging = false;

            if (redDot.Top < gridBox.Top)
            {
                redDot.Top = gridBox.Top;
            }
            else if (redDot.Top > gridBox.Top + gridBox.Height)
            {
                redDot.Top = gridBox.Top + gridBox.Height - redDot.Height;
            }

            if (redDot.Left < gridBox.Left)
            {
                redDot.Left = gridBox.Left;
            }
            else if (redDot.Left > gridBox.Left + gridBox.Width)
            {
                redDot.Left = gridBox.Left + gridBox.Width - redDot.Width;
            }
        }