public Form1()
 {
     InitializeComponent();
     screenwidth  *= dpi;
     screenheight *= dpi;
     EmulateClick.Intitialize((int)screenwidth, (int)screenheight, 10);
     MouseHook.MouseDown += MouseHook_MouseDown;
     DPITools.DpiFix();
     Width       = (int)(Width * dpi);
     Height      = (int)(Height * dpi);
     defaultsize = Size;
     mapsfolder  = res + "maps/";
     console     = new GConsole(this, "Seterra Geography Solver [Version 1.00.00]\r\n" +
                                "(c) 2018 Foma Shipilov. All rights reserved.", "SGS:\\" + Environment.UserName + ">");
     console.CommandReceived += Console_CommandReceived;
 }
 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;
 }