コード例 #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
ファイル: MouseWheel.cs プロジェクト: heartszhang/WeiZhi3
    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);
    }
コード例 #3
0
        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
ファイル: MouseWheel.cs プロジェクト: Master-MiShutka/TMPApps
        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();
   }
 }