Exemple #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
        }
Exemple #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();
            }
        }
        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);
            }
        }
Exemple #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();
            }
        }
Exemple #6
0
 protected override IMouseWheelShaft     GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase)
 {
     return(transferCase[0]);
 }
 protected override IMouseWheelShaft GetMotionShaft(MouseWheel wheel, IMouseWheelTransferCase transferCase) { return transferCase[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
 }
 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();
   }
 }