public OverlayForm(MouseController controller, Configuration configuration, OverlayEye overlayEyeForm)
        {
            InitializeComponent();

            this.KeyPreview     = true;
            this.overlayEyeForm = overlayEyeForm;

            SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW));
            this.controller = controller;
            mConfiguration  = configuration;
            this.KeyDown   += new KeyEventHandler(HandleEsc);
        }
Ejemplo n.º 2
0
        public Main(Configuration configuration)
        {
            InitializeComponent();

            this.KeyPreview = true;
            this.KeyDown   += new KeyEventHandler(HandleEsc);
            TopMost         = true;
            mConfiguration  = configuration;
            controller      = new MouseController(this, mConfiguration);

            // controller.setMode(MouseController.Mode.EYEX_AND_EVIACAM);

            StartPosition = FormStartPosition.CenterScreen;

            //movementHotKey = (Keys)Enum.Parse(typeof(Keys), Properties.Settings.Default.MovementKey);
            //clickHotKey = (Keys)Enum.Parse(typeof(Keys), Properties.Settings.Default.ClickOnKey);
            //pauseHotKey = (Keys)Enum.Parse(typeof(Keys), Properties.Settings.Default.PauseOnKey);

            _globalKeyboardHook = new GlobalKeyboardHook();
            //  _globalKeyboardHook.KeyboardPressed += OnKeyPressed;

            controller.setMovement(MouseController.Movement.HOTKEY);
            controller.Sensitivity = SensitivityInput.Value;
            controller.setMovement(MouseController.Movement.CONTINUOUS);
            controller.setMode(MouseController.Mode.EYEX_ONLY);
            //warpBar.Enabled = true;
            gazeTracker.Enabled = true;

            OverlayEye overlayEyeForm = new OverlayEye(mConfiguration, controller);

            overlayEyeForm.Show();


            // OverlayEyeNew overlayEyeNew = new OverlayEyeNew(mConfiguration, MousePosition, controller);
            //overlayEyeNew.Show();
            // controller.Sensitivity = 5;


            overlay = new OverlayForm(controller, mConfiguration, overlayEyeForm);
            // overlay = new OverlayForm(controller, mConfiguration, overlayEyeNew);
            overlay.ShowWarpBar     = true;
            overlay.ShowGazeTracker = false;
            overlay.ShowIfTracking();


            refreshTimer          = new Timer();
            refreshTimer.Tick    += new EventHandler(RefreshScreen);
            refreshTimer.Tick    += new EventHandler(overlayEyeForm.HandleTimer);
            refreshTimer.Interval = 33;
            refreshTimer.Start();
        }