Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            // Register an status-changed event listener for user presence.
            // NOTE that the event listener must be unregistered too. This is taken care of in the Dispose(bool) method.
            _eyeXHost.UserPresenceChanged += EyeXHost_UserPresenceChanged;
            _eyeXHost.GazeTrackingChanged += EyeXHost_GazeTrackingChanged;

            // Start the EyeX host.
            _eyeXHost.Start();

            // Wait until we're connected.
            if (_eyeXHost.WaitUntilConnected(TimeSpan.FromSeconds(5)))
            {
                // Make sure the EyeX Engine version is equal to or greater than 1.4.
                var engineVersion = _eyeXHost.GetEngineVersion().Result;
                if (engineVersion.Major != 1 || engineVersion.Major == 1 && engineVersion.Minor < 4)
                {
                    _labelHasGazeTracking.ForeColor = Color.Red;
                    _labelHasGazeTracking.Text      = "Requires EyeX Engine 1.4";
                }
            }
            else
            {
                MessageBox.Show("Could not connect to EyeX engine.");
            }
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();
            contextMenu        = new ContextMenu();
            menuItemExit       = new MenuItem();
            menuItemStartOnOff = new MenuItem();
            settingsItem       = new MenuItem();
            initMenuItem();

            highlightPannerList = new List <Panel>();
            highlightPannerList.Add(pnlHiLteRightClick);
            highlightPannerList.Add(pnlHighLightSingleLeft);
            highlightPannerList.Add(pnlHighLightDoubleClick);
            //highlightPannerList.Add(pnlHighLightDragAndDrop);
            highlightPannerList.Add(pnlHighLightScrol);
            highlightPannerList.Add(pnlHighLightKeyboard);
            highlightPannerList.Add(pnlHighLightSettings);
            setButtonPanelHight(highlightPannerList);


            eyeXHost = new FormsEyeXHost();
            eyeXHost.Start();

            keyboardInitializer    = new OptiKey.GazeKeyboard();
            keyboard               = keyboardInitializer.CreateKeyboard();
            keyboard.ShowInTaskbar = false;

            connectBehaveMap();
        }
        public FixationDetection(FormsEyeXHost EyeXHost)
        {
            if (!EyeXHost.IsStarted)
            {
                EyeXHost.Start();
            }

            customfixStream = new CustomFixationDataStream(EyeXHost);

            customfixStream.next += detectFixation;

            //Timer to run selected interaction with OS\aapplication user is trying to interact with, once gaze is longer than specified limit
            //the delegate that has been set in SelectedFixationAcion is run but the timer elapsed event.
            FixationDetectionTimeLength = 1500;
            FixationExtensionBuffer     = 100;

            FixationTimeOutLength = 7000;

            timeOutTimer = new Timer(FixationTimeOutLength);

            timeOutTimer.AutoReset = false;

            timeOutTimer.Elapsed += fixationTimeOut;


            fixationTimer = new System.Timers.Timer(FixationDetectionTimeLength);

            fixationTimer.AutoReset = false;

            fixationTimer.Elapsed += runActionWhenTimerReachesLimit;
        }
        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;
        }
Beispiel #5
0
        static void Main()
        {
            _eyeXHost.Start();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            _eyeXHost.Dispose();
        }
        static void Main()
        {
            using (EyeXHost = new FormsEyeXHost())
            {
                // Start the EyeX host.
                EyeXHost.Start();

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new PannableForm());
            }
        }
Beispiel #7
0
        public VoiceClickerForm()
        {
            InitializeComponent();

            Host.Start();

            Rec.UnloadAllGrammars();
            Rec.LoadGrammar(new Grammar(new Choices("click", "okay")));
            Rec.SpeechRecognized += TriggerActivation;
            Rec.SetInputToDefaultAudioDevice();
            Rec.RecognizeAsync(RecognizeMode.Multiple);
        }
Beispiel #8
0
        static void Main()
        {
            _eyeXHost.Start();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Carrega as configurações
            if (!CConfig.Instance.LoadData())
            {
                return;
            }

            Application.Run(new FMain());

            _eyeXHost.Dispose();
        }