public OverlayForm(MouseController controller, Configuration configuration, OverlayEyeNew overlayEyeNew) { InitializeComponent(); this.KeyPreview = true; this.overlayEyeNewForm = overlayEyeNew; SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW)); this.controller = controller; this.mConfiguration = configuration; this.KeyDown += new KeyEventHandler(HandleEsc); }
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); controller.setMovement(MouseController.Movement.HOTKEY); controller.Sensitivity = SensitivityInput.Value; controller.setMovement(MouseController.Movement.CONTINUOUS); //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.setMode(MouseController.Mode.EYEX_ONLY); //warpBar.Enabled = true; gazeTracker.Enabled = true; OverlayEye overlayEyeForm = new OverlayEye(mConfiguration, controller); //overlayEyeForm.Show(); controller.Sensitivity = 7; OverlayEyeNew overlayEyeNew = new OverlayEyeNew(mConfiguration, MousePosition); overlayEyeNew.Show(); overlay = new OverlayForm(controller, mConfiguration, overlayEyeForm); overlay.ShowWarpBar = true; overlay.ShowGazeTracker = false; overlay.ShowIfTracking(); refreshTimer = new Timer(); refreshTimer.Tick += new EventHandler(RefreshScreen); refreshTimer.Tick += new EventHandler(overlayEyeForm.HandleTimer); //refreshTimer.Tick += new EventHandler(overlayEyeNew.HandleTimer); refreshTimer.Interval = 33; refreshTimer.Start(); }
public Point GetNextPoint(Point warpPoint) { System.Drawing.Rectangle screenSize = OverlayEyeNew.GetScreenSize(); if (sampleCount >= 5) { currentPoint = calculateSmoothedCalibratedPoint(); double basePitch = (warpPoint.Y - screenSize.Height / 2.0) / (screenSize.Height / 2.0) * 50.0; int yOffset = (int)((currentPoint.Y - basePitch) * sensitivity / 5); double baseYaw = (warpPoint.X - screenSize.Width / 2.0) / (screenSize.Width / 2.0) * 150.0; int xOffset = (int)((currentPoint.X - baseYaw) * sensitivity / 5); warpPoint.Offset(xOffset, yOffset); return(warpPoint); } return(warpPoint); }
public MouseController(OverlayEyeNew form, Configuration configuration) { this.formMagnifier = form; mConfiguration = configuration; overlayEyeNewFormIsThere = true; }