public HPBvelocityPlay(int offThresh, int onThresh, float sensitivity, float maxSwing, float filterSensitivity)
 {
     this.offThresh   = offThresh;
     this.onThresh    = onThresh;
     this.sensitivity = sensitivity;
     this.maxVelocity = maxSwing;
     filter           = new PointFilterMAExpDecaying(filterSensitivity);
 }
예제 #2
0
        public AutoScroller(ScrollViewer scrollViewer, int radiusThreshold, int proportional, IPointFilter filter)
        {
            this.radiusThreshold = radiusThreshold;
            this.filter          = filter;
            this.scrollViewer    = scrollViewer;
            this.proportional    = proportional;

            // Setting scrollviewer dimensions
            lastSampledPoint = new Point();
            basePosition     = scrollViewer.PointToScreen(new System.Windows.Point(0, 0));
            scrollCenter     = new System.Windows.Point(scrollViewer.ActualWidth / 2, scrollViewer.ActualHeight / 2);

            // Setting sampling timer
            samplerTimer.Interval = new TimeSpan(10000);//1000; //1;
            //samplerTimer.MicroTimerElapsed += SamplerTimer_MicroTimerElapsed;
            samplerTimer.Tick += ListenMouse;
            samplerTimer.Start();
        }