예제 #1
0
        protected IMouseWheelShaft GetMotionShaftAuto(MouseWheel wheel, IMouseWheelTransferCase transferCase,
                                                      int debouncingCellCount)
        {
            var resolution = wheel.Resolution;

            if (DoubleEx.AreClose(resolution, (int)resolution))
            {
                return(transferCase[debouncingCellCount]); // the most granular debouncing
            }
            return(transferCase[0]);                       // no debouncing if wheel resolution not integral
        }
예제 #2
0
    public MouseWheel(MouseDevice mouseDevice = null, int id = 0)
    {
      Current = this;
      _mouseDevice = mouseDevice;
      Id = id;
      Name = GetName();

      _activeTransferCase = _stdResTransferCase = new MouseWheelSingleShaftTransferCase(0);
      Next = _activeTransferCase;

      if (s_newWheel != null)
        s_newWheel(this, EventArgs.Empty);
    }
        protected override IMouseWheelShaft GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase)
        {
            switch (Debouncing)
            {
            case MouseWheelDebouncing.Auto:   return(GetMotionShaftAuto(wheel, transferCase, ScrollIncrement));

            case MouseWheelDebouncing.None:   return(transferCase[0]);

            case MouseWheelDebouncing.Single: return(transferCase[1]);

            default: throw new NotImplementedException();
            }
        }
예제 #4
0
        public MouseWheel(MouseDevice mouseDevice = null, int id = 0)
        {
            Current           = this;
            this._mouseDevice = mouseDevice;
            this.Id           = id;
            this.Name         = this.GetName();

            this._activeTransferCase = this._stdResTransferCase = new MouseWheelSingleShaftTransferCase(0);
            this.Next = this._activeTransferCase;

            if (s_newWheel != null)
            {
                s_newWheel(this, EventArgs.Empty);
            }
        }
예제 #5
0
        protected virtual IMouseWheelShaft      GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase)
        {
            switch (Debouncing)
            {
            case MouseWheelDebouncing.Auto:
                return(GetMotionShaftAuto(wheel, transferCase, -1));

            case MouseWheelDebouncing.None:
                return(transferCase[0]);     // no debouncing

            case MouseWheelDebouncing.Single:
                return(transferCase[1]);     // one debouncing cell per click - same as a standard resolution notch

            default:
                throw new NotImplementedException();
            }
        }
예제 #6
0
 protected override IMouseWheelShaft     GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase)
 {
     return(transferCase[0]);
 }
예제 #7
0
 protected override IMouseWheelShaft GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase) { return transferCase[0]; }
예제 #8
0
 protected IMouseWheelShaft GetMotionShaftAuto(MouseWheel wheel, IMouseWheelTransferCase transferCase, int debouncingCellCount)
 {
   var resolution = wheel.Resolution;
   if (DoubleEx.AreClose(resolution, (int)resolution))
     return transferCase[debouncingCellCount];  // the most granular debouncing
   else
     return transferCase[0];   // no debouncing if wheel resolution not integral
 }
예제 #9
0
 protected virtual IMouseWheelShaft GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase)
 {
   switch (Debouncing)
   {
     case MouseWheelDebouncing.Auto:   return GetMotionShaftAuto(wheel, transferCase, -1);
     case MouseWheelDebouncing.None:   return transferCase[ 0];  // no debouncing
     case MouseWheelDebouncing.Single: return transferCase[ 1];  // one debouncing cell per click - same as a standard resolution notch
     default: throw new NotImplementedException();
   }
 }