示例#1
0
        private void createCursorControl()
        {
            try
            {
                cs = new CursorControl();
            }
            catch (Exception)
            {
                alert("ERROR: Unable to Control Cursor!", "ERROR Message");
                Close();
            }
            btnCursor.Content = "Turn ON Cursor Control";

            //*
            try
            {
                mh = new MouseHook();
                mh.MouseMovement += new MouseHookEventHandler(mh_MouseMovement);
                mh.StartMouseHook();
            }
            catch (Exception)
            {
                alert("WARNING: Unable to use mouse movement to stop eye-tracking!", "WARNING Message");
            }
        }
        private void ButtonMouseClicked(object sender, RoutedEventArgs e)
        {
            if (GazeManager.Instance.IsCalibrated == false)
            {
                return;
            }

            if (cursorControl == null)
            {
                cursorControl = new CursorControl(activeScreen, true, true); // Lazy initialization
            }
            else
            {
                cursorControl.Enabled = !cursorControl.Enabled; // Toggle on/off
            }
            UpdateState();
        }