Пример #1
0
        protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
        {
            double scaleX;
            double scaleY;

            if (velocity > 150)
            {
                scaleX = _ScaleFactorX;
                scaleY = _ScaleFactorY;
            }
            else if (velocity > 100)
            {
                scaleX = _ScaleFactorX * 2.0 / 3.0;
                scaleY = _ScaleFactorY * 2.0 / 3.0;
            }
            else if (velocity > 50)
            {
                scaleX = _ScaleFactorX * 1.0 / 3.0;
                scaleY = _ScaleFactorY * 1.0 / 3.0;
            }
            else
            {
                scaleX = 1;
                scaleY = 1;
            }
            var x = Convert.ToInt32(GetX(change) * 2 * scaleX);
            var y = Convert.ToInt32(GetY(change) * 2 * scaleY);

            InputSimulator.Mouse.MoveMouseBy(x, -y);
        }
Пример #2
0
 protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
 {
     var linesToScroll = (IsInverted ? -Lines : Lines) * Math.Sign(GetX(change));
     if (IsAccelerated)
         linesToScroll *= Convert.ToInt32(Math.Floor(change.Magnitude / MinDistance));
     InputSimulator.Mouse.VerticalScroll(linesToScroll);
 }
Пример #3
0
        protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
        {
            double scaleX;
            double scaleY;
            if (velocity > 150)
            {
                scaleX = _ScaleFactorX;
                scaleY = _ScaleFactorY;
            }
            else if (velocity > 100)
            {
                scaleX = _ScaleFactorX * 2.0 / 3.0;
                scaleY = _ScaleFactorY * 2.0 / 3.0;
            }
            else if (velocity > 50)
            {
                scaleX = _ScaleFactorX * 1.0 / 3.0;
                scaleY = _ScaleFactorY * 1.0 / 3.0;
            }
            else
            {
                scaleX = 1;
                scaleY = 1;
            }
            var x = Convert.ToInt32(GetX(change) * 2 * scaleX);
            var y = Convert.ToInt32(GetY(change) * 2 * scaleY);

            InputSimulator.Mouse.MoveMouseBy(x, -y);
        }
Пример #4
0
        protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
        {
            var linesToScroll = (IsInverted ? -Lines : Lines) * Math.Sign(GetX(change));

            if (IsAccelerated)
            {
                linesToScroll *= Convert.ToInt32(Math.Floor(change.Magnitude / MinDistance));
            }
            InputSimulator.Mouse.VerticalScroll(linesToScroll);
        }
Пример #5
0
        protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
        {
            var linesToScroll = Lines;
            if (IsAccelerated)
                linesToScroll *= Convert.ToInt32(Math.Floor(Math.Abs(change.Magnitude) / MinDistance));

            var isUp = ((IsInverted ? -1 : 1) * Math.Sign(GetX(change)) == 1);

            for (var i = 0; i < linesToScroll; i++)
                Native.ScrollActiveWindow(isUp);
        }
Пример #6
0
        protected override void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity)
        {
            var linesToScroll = Lines;

            if (IsAccelerated)
            {
                linesToScroll *= Convert.ToInt32(Math.Floor(Math.Abs(change.Magnitude) / MinDistance));
            }

            var isUp = ((IsInverted ? -1 : 1) * Math.Sign(GetX(change)) == 1);

            for (var i = 0; i < linesToScroll; i++)
            {
                Native.ScrollActiveWindow(isUp);
            }
        }
Пример #7
0
 protected abstract void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity);
Пример #8
0
 protected abstract void ApplyPositionUpdate(PersistentHand hand, Vector change, int velocity);