//Constructor public ScrollControl(int scrollStepTimerDuration, int InitialScrollScalarValue, int deadZoneHorizontalPercent, int deadZoneVerticalPercent, FormsEyeXHost EyeXHost) { //set scroll step timer duration. ScrollStepTimerDuration = scrollStepTimerDuration; //Connect to eyeX engine gaze stream. gazeStream = EyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered); //Create gate points event handler delegate EventHandler <GazePointEventArgs> gazeDel = new EventHandler <GazePointEventArgs>(updateGazeCoodinates); //register delegate with gaze data stream next event. gazeStream.Next += gazeDel; //set up scroll step timer scrollStepTimer = new Timer(ScrollStepTimerDuration); //Set to auto reset so that it fires events continuously at the ScrollStepTimerDuration scrollStepTimer.AutoReset = true; //Register scroll method with timer elapsed event. scrollStepTimer.Elapsed += scroll; //Set initial deadzone size of screen percent. DeadZoneHorizontalPercent = deadZoneHorizontalPercent; DeadZoneVerticalPercent = deadZoneVerticalPercent; //run SetDeadZoneBounds method to set up the deadZoneRect field initially. SetDeadZoneBounds(); //pass in ScrollscalarValue, this will be set by the users saved settings. ScrollScalarValue = InitialScrollScalarValue; }
public ZoomMagnifier(Form displayform, Point fixationPoint) { ZOOM_MAX = Program.readSettings.maxZoom; //Max zoom amount Magnification = DO_ZOOM ? 1 : Program.readSettings.maxZoom; //Set magnification to the max if not zooming form = displayform; form.TopMost = true; updateTimer = new Timer(); FixationPoint = fixationPoint; InitLens(); //Event handlers form.Resize += new EventHandler(form_Resize); form.FormClosing += new FormClosingEventHandler(form_FormClosing); updateTimer.Tick += new EventHandler(timer_Tick); updateTimer.Interval = UPDATE_SPEED; updateTimer.Enabled = false; Offset = new Point(0, 0); SecondaryOffset = new Point(0, 0); eyeXHost = new FormsEyeXHost(); eyeXHost.Start(); gazeStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered); gazeStream.Next += (s, e) => SetLook(e.X, e.Y); form.Left = -4000; form.Top = -5000; form.Width = 1; form.Height = 1; }
public ShortcutKeyWorker(KeyboardHook KeyboardObserver, Dictionary <ActionToBePerformed, String> KeyAssignments, FormsEyeXHost EyeXHost)//, Dictionary<EToolBarFunction, String> KeyAssignments) { keyBoardHook = KeyboardObserver; keyBoardHook.OnKeyPressed += RunKeyFunction; keyAssignments = KeyAssignments; //Connect to eyeX engine gaze stream. gazeStream = EyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered); //Create gate points event handler delegate gazeDel = new EventHandler <GazePointEventArgs>(updateGazeCoodinates); //register delegate with gaze data stream next event. gazeStream.Next += gazeDel; }
//Constructor public CustomFixationDataStream(FormsEyeXHost EyeXHost) { gazeStream = EyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered); //Create gate points event handler delegate EventHandler <GazePointEventArgs> gazeDel = new EventHandler <GazePointEventArgs>(updateGazeCoodinates); //register delegate with gaze data stream next event. gazeStream.Next += gazeDel; gPAverage = new GazePoint(); xBuffer = new double[bufferSize]; yBuffer = new double[bufferSize]; fixationState = EFixationStreamEventType.Waiting; }
//Constructor public CustomFixationDataStream(FormsEyeXHost EyeXHost) { //Calculate the amount of pixels away from the top of the screen to set cut of for top of screen threshold adjustment. yFixationScreenBoundary = Constants.PRIMARY_SCREEN.Height * (screenBoudaryCutOffPercent / 100); gazeStream = EyeXHost.CreateGazePointDataStream(GazePointDataMode.Unfiltered); //Create gate points event handler delegate EventHandler <GazePointEventArgs> gazeDel = new EventHandler <GazePointEventArgs>(updateGazeCoodinates); //register delegate with gaze data stream next event. gazeStream.Next += gazeDel; gPAverage = new GazePoint(); xBuffer = new double[bufferSize]; yBuffer = new double[bufferSize]; fixationState = EFixationStreamEventType.Waiting; ZoomerFixation = false; }