/// <summary> /// Starts moving the mouse in the grid mode, in the specified /// direction /// </summary> /// <param name="direction">down or up</param> private void startGridSweep(GridMouseMover.GridSweepDirections direction) { if (_gridMouseMover.IsIdle()) { _mode = MouseMode.Grid; pause(); _gridMouseMover.SetGridSweepDirection(direction); AuditLog.Audit(new AuditEventMouseMover("grid", direction.ToString())); _gridMouseMover.Start(); } }
/// <summary> /// Form loader. Initialize, subscribe to events. /// </summary> /// <param name="sender">event sender</param> /// <param name="e">event arg</param> private void MouseScannerScreen_Load(object sender, EventArgs e) { _scannerCommon.HideTalkWindow(); _scannerCommon.OnLoad(); _radarMouseMover = createRadarMouseMover(); _gridMouseMover = createGridMouseMover(); Context.AppActuatorManager.EvtSwitchHook += AppActuatorManager_EvtSwitchHook; var actuator = Context.AppActuatorManager.GetActuator(typeof(KeyboardActuator)); if (actuator is KeyboardActuator) { _keyboardActuator = actuator as KeyboardActuator; _keyboardActuator.EvtMouseDown += MouseScannerScreen_EvtMouseDown; } _scannerCommon.GetAnimationManager().Start(_scannerCommon.GetRootWidget()); }
/// <summary> /// Starts moving the mouse in the grid mode, in the specified /// direction /// </summary> /// <param name="direction">down or up</param> private void startGridSweep(GridMouseMover.Direction direction) { pause(); _gridMouseMover = createGridMouseMover(); AuditLog.Audit(new AuditEventMouseMover(direction.ToString())); _gridMouseMover.GridRectangleDirection = direction; _gridMouseMover.Start(); _gridMouseMover = null; resume(); }
/// <summary> /// Creates and initializes the object that will handle grid mouse /// movement. /// </summary> /// <returns>The created object</returns> private GridMouseMover createGridMouseMover() { var gridMouseMover = new GridMouseMover { Cycles = Common.AppPreferences.MouseGridVerticalSweeps, Sweeps = Common.AppPreferences.MouseGridHorizontalSweeps, MouseSpeed = Common.AppPreferences.MouseGridHorizontalSpeed, ScanSpeed = Common.AppPreferences.MouseGridVerticalSpeed, LineWidth = Common.AppPreferences.MouseGridLineWidth, StartFromLastCursorPos = Common.AppPreferences.MouseGridStartFromLastCursorPos, GridScanSpeedMultiplier = Common.AppPreferences.MouseGridScanSpeedMultiplier, MouseMoveSpeedMultiplier = Common.AppPreferences.MouseGridMouseMoveSpeedMultiplier }; gridMouseMover.Init(); gridMouseMover.EvtMouseMoverStateChanged += _gridMouseMover_EvtMouseMoverStateChanged; return gridMouseMover; }
/// <summary> /// Creates and initializes the object that will handle grid mouse /// movement. /// </summary> /// <returns>The created object</returns> private GridMouseMover createGridMouseMover() { var gridMouseMover = new GridMouseMover { GridRectangleSpeed = Common.AppPreferences.MouseGridRectangleSpeed, GridRectangleCycles = Common.AppPreferences.MouseGridRectangleCycles, GridLineSpeed = Common.AppPreferences.MouseGridLineSpeed, GridLineCycles = Common.AppPreferences.MouseGridRectangleCycles, GridLineThickness = Common.AppPreferences.MouseGridLineThickness, EnableVerticalGridRectangle = Common.AppPreferences.MouseGridEnableVerticalRectangleScan }; return gridMouseMover; }