Example #1
0
 private void timerFS_Tick(object sender, EventArgs e)
 {
     if (timerFS.IsEnabled == true)
     {
         if (FSUIPCConnection.IsOpen)
         {
             if (rdForward.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.W);
             }
             if (rdBackwards.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.S);
             }
             if (rdLeft.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.A);
             }
             if (rdRight.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.D);
             }
             if (rdLookup.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.NumPad8);
             }
             if (rdLookdown.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.NumPad2);
             }
             if (rdLookleft.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.NumPad4);
             }
             if (rdLookright.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.NumPad6);
             }
             if (rdIncreaseAlt.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.R);
             }
             if (rdDecreaseAlt.IsChecked == true)
             {
                 FSUIPCConnection.SendKeyToFS(Keys.F);
             }
             if (rdCustomActions.IsChecked == true)
             {
                 var arrCustom = txtCustom.Text.Split(',');
                 if (arrCustom.Length > 0)
                 {
                     foreach (var item in arrCustom)
                     {
                         try
                         {
                             FSUIPCConnection.SendKeyToFS((Keys)Enum.Parse(typeof(Keys), item, true));
                         }
                         catch { }
                     }
                 }
             }
         }
         SavePicture();
     }
 }