private void StartMapAdding()
 {
     console.BlockInput = true;
     AnalizeBrowser();
     clicks   = new List <double[]>();
     testkeys = new List <Bitmap>();
     MouseHook.InstallHook();
     console.WriteLine("Hook successfully installed. Awaiting input...\r\n\r\n" +
                       "Though you are not limited by time you have to complete the test without a single mistake, so please be careful!\r\n" +
                       "Once the test is finished simply click on the program's window to save map!\r\n");
 }
 private void SolveMap(MouseEventArgs e)
 {
     MouseHook.UnInstallHook();
     console.WriteLine("Hook disabled. Process started.\r\n");
     EmulateClick.LeftClick(e.X, e.Y);
     System.Threading.Thread.Sleep(500);
     for (int i = 0; i < testkeys.Count * 5; i++)
     {
         int ind;
         try { ind = SearchKey(GetKey()).X; }
         catch { break; }
         EmulateClick.LeftClick((int)Math.Round((double)currentbounds.Width / clicks[ind][0]) + currentbounds.X,
                                (int)Math.Round((double)currentbounds.Width / clicks[ind][1]) + currentbounds.Y);
     }
     console.Write("Done! Press \'Enter\' to continue...");
     mode = Mode.FinishSolving;
     console.BlockInput = false;
 }