Beispiel #1
0
        static void Main()
        {
            Console.WriteLine("                                                         ");
            Console.WriteLine(" -[ Keyhole v0.1 -- https://github.com/gaasedelen/keyhole");
            Console.WriteLine("                                                         ");
            Console.WriteLine("     ... an exprimental accessibility technology         ");
            Console.WriteLine("                                                         ");
            Console.WriteLine("                      by markus gaasedelen, (c) 2020     ");
            Console.WriteLine("                                                         ");
            Console.WriteLine("---------------------------------------------------------");

            var argv = Environment.GetCommandLineArgs();

            // the default 'hotkey' for the keyhole overlay (F20, lol)
            var overlayKey = Keys.F20;

            // if the user specifies an arg to the program, this will be the default key
            if (argv.Length == 3 && argv[1] == "-k")
            {
                overlayKey = (Keys)System.Enum.Parse(typeof(Keys), argv[2]);
            }

            Console.WriteLine("Using '" + overlayKey.ToString() + "' as the default hotkey, use -k <key> to change...");

            Keyhole k = new Keyhole(overlayKey);

            Application.Run(k.window);
        }
Beispiel #2
0
 public Form1(Keyhole parent)
 {
     this.parent     = parent;
     this.m_Bitmap   = new Bitmap(parent.Screen.Width, parent.Screen.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
     this.m_Graphics = Graphics.FromImage(this.m_Bitmap);
     this.m_Graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
     InitializeComponent();
 }