コード例 #1
0
        public StateManager(Form1 Toolbar, ShortcutKeyWorker shortCutKeyWorker, FormsEyeXHost EyeXHost)
        {
            eyeXHost = EyeXHost;
            toolbar  = Toolbar;

            SystemFlags.currentState = SystemState.Wait;

            fixationWorker = new FixationDetection(eyeXHost, 25);

            scrollWorker = new ScrollControl(200, 5, 50, 20, eyeXHost);

            SystemFlags.currentState = SystemState.Wait;

            SystemFlags.hasSelectedButtonColourBeenReset = true;

            // Instantiate the ZoomLens, this is the form that is given to magnifier
            zoomer = new ZoomLens();
            // Instantiate the magnifier, this is Sam Medlocks refactored magnifier
            // This calls the low-level API
            magnifier = CreateMagnifier();

            //Console.WriteLine(scrollWorker.deadZoneRect.LeftBound + "," + scrollWorker.deadZoneRect.RightBound + "," + scrollWorker.deadZoneRect.TopBound + "," + scrollWorker.deadZoneRect.BottomBound);

            this.shortCutKeyWorker = shortCutKeyWorker;

            Run();
        }
コード例 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            FKeyMapDictionary = new Dictionary <ActionToBePerformed, string>();
            FKeyMapDictionary.Add(ActionToBePerformed.DoubleClick, ValueNeverChange.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.LeftClick, ValueNeverChange.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.Scroll, ValueNeverChange.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.RightClick, ValueNeverChange.KEY_FUNCTION_UNASSIGNED_MESSAGE);


            //Instantiate keyboard hook and pass into worker class.
            LowLevelKeyBoardHook = new KeyboardHook();

            shortCutKeyWorker = new ShortcutKeyWorker(LowLevelKeyBoardHook, FKeyMapDictionary, eyeXHost);

            //Start monitoring key presses.
            LowLevelKeyBoardHook.HookKeyboard();
            Edge = AppBarEdges.Right;
            //TODO: Need to be replaced

            //if(Program.readSettings.position == "left")
            //{
            //    Edge = AppBarEdges.Left;
            //}
            //else
            //{
            //    Edge = AppBarEdges.Right;
            //}
            stateManager = new StateManager(this, shortCutKeyWorker, eyeXHost);
            stateManager.fixationWorker.FixationDetectionTimeLength           = Program.readSettings.fixationTimeLength;
            stateManager.fixationWorker.FixationTimeOutLength                 = Program.readSettings.fixationTimeOut;
            stateManager.fixationWorker.fixationTimer.Interval                = Program.readSettings.fixationTimeLength;
            stateManager.fixationWorker.timeOutTimer.Interval                 = Program.readSettings.fixationTimeOut;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.LeftClick]   = Program.readSettings.leftClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.DoubleClick] = Program.readSettings.doubleClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.RightClick]  = Program.readSettings.rightClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.Scroll]      = Program.readSettings.scoll;
            timer2.Enabled = true;
        }
コード例 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            FKeyMapDictionary = new Dictionary <ActionToBePerformed, string>();
            FKeyMapDictionary.Add(ActionToBePerformed.DoubleClick, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.LeftClick, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.Scroll, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.RightClick, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.MicInput, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);
            FKeyMapDictionary.Add(ActionToBePerformed.MicInputOff, Constants.KEY_FUNCTION_UNASSIGNED_MESSAGE);


            //Instantiate keyboard hook and pass into worker class.
            LowLevelKeyBoardHook = new KeyboardHook();

            shortCutKeyWorker = new ShortcutKeyWorker(LowLevelKeyBoardHook, FKeyMapDictionary, eyeXHost);

            //Start monitoring key presses.
            LowLevelKeyBoardHook.HookKeyboard();
            Edge = AppBarEdges.Right;

            stateManager = new StateManager(this, shortCutKeyWorker, eyeXHost);
            stateManager.fixationWorker.FixationDetectionTimeLength = Program.readSettings.fixationTimeLength;
            stateManager.fixationWorker.FixationTimeOutLength       = Program.readSettings.fixationTimeOut;
            stateManager.fixationWorker.fixationTimer.Interval      = Program.readSettings.fixationTimeLength;
            stateManager.fixationWorker.timeOutTimer.Interval       = Program.readSettings.fixationTimeOut;
            stateManager.magnifier.MaxZoom = Program.readSettings.maxZoom;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.LeftClick]   = Program.readSettings.leftClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.DoubleClick] = Program.readSettings.doubleClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.RightClick]  = Program.readSettings.rightClick;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.Scroll]      = Program.readSettings.scoll;
            shortCutKeyWorker.keyAssignments[ActionToBePerformed.MicInput]    = Program.readSettings.micInput;
            timer2.Enabled = true;

            Height = (int)System.Windows.SystemParameters.PrimaryScreenHeight;

            String[] sidebarArrangement = Program.readSettings.sidebar;
            ArrangeSidebar(sidebarArrangement);
        }
コード例 #4
0
        public StateManager(Form1 Toolbar, ShortcutKeyWorker shortCutKeyWorker, FormsEyeXHost EyeXHost)
        {
            eyeXHost = EyeXHost;
            toolbar  = Toolbar;

            SystemFlags.currentState = SystemState.Wait;

            fixationWorker = new FixationDetection(eyeXHost);

            scrollWorker = new ScrollControl(200, 5, 50, 20, eyeXHost);

            SystemFlags.currentState = SystemState.Wait;

            SystemFlags.hasSelectedButtonColourBeenReset = true;

            zoomer = new ZoomLens(fixationWorker, eyeXHost);

            Console.WriteLine(scrollWorker.deadZoneRect.LeftBound + "," + scrollWorker.deadZoneRect.RightBound + "," + scrollWorker.deadZoneRect.TopBound + "," + scrollWorker.deadZoneRect.BottomBound);
            corner = new Corner();

            this.shortCutKeyWorker = shortCutKeyWorker;

            Run();
        }