/// <summary> /// Sends a mouse wheel event to the OS. /// </summary> /// <param name="Direction">The direction to turn the wheel.</param> /// <param name="NumberOfRolls">The number of times to roll the wheel.</param> public static void SendWheel(WheelActions Direction, int NumberOfRolls) { if (NumberOfRolls <= 0) throw new ArgumentException("The number of rolls must be greater than zero", "NumberOfRolls"); //get the default value int deltatosend = delta; //multiply by how many times we want to roll the wheel deltatosend *= (int)NumberOfRolls; //specify the direction to roll the wheel deltatosend *= (Direction == WheelActions.Up ? 1 : -1); //roll the wheel MouseSimulator.MouseWheel(deltatosend); }
/// <summary> /// Initializes a new instance of the <see cref="MouseWheelTrigger"/> class. /// </summary> /// <param name="Action">The action.</param> public MouseWheelTrigger(WheelActions Action) : this(Action, true) { }
/// <summary> /// Initializes a new instance of the <see cref="MouseWheelTrigger"/> class. /// </summary> /// <param name="Action">The action.</param> /// <param name="ShouldHandle">if set to <c>true</c> the trigger should handle the event.</param> public MouseWheelTrigger(WheelActions Action,bool ShouldHandle) : base(EventTypes.MouseWheel, ShouldHandle) { action = Action; Mouse.Hook.MouseWheel += new MouseEventHandler(OnMouseWheel); }
/// <summary> /// Initializes a new instance of the <see cref="TriggerAttribute"/> class. /// </summary> /// <param name="Action">The action.</param> public TriggerAttribute(WheelActions Action) { eventdata = new MouseWheelTrigger(Action); }
/// <summary> /// Sends a mouse wheel event to the OS. /// </summary> /// <param name="Direction">The direction to turn the wheel.</param> public static void SendWheel(WheelActions Direction) { SendWheel(Direction, 1); }