public GazeToolbar() { actionHandler = new ActionHandler(); keyboardHook = new KeyboardHook(); manager = new StateManager_new(); //TODO: move FKeyMapDictionary to ShortcutKeyWorker class and see if eyeXHost is needed //shortcutKeyWorker = new ShortcutKeyWorker(keyboardHook, FKeyMapDictionary, eyeXHost); //Start monitoring key presses. keyboardHook.HookKeyboard(); //The menu that appears in the system tray trayMenu = new TrayMenu(); trayMenu.menuExit.Click += new EventHandler(MenuCloseClick); }
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; }
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); }