当前位置: 首页>>代码示例>>C#>>正文


C# MouseButtons类代码示例

本文整理汇总了C#中MouseButtons的典型用法代码示例。如果您正苦于以下问题:C# MouseButtons类的具体用法?C# MouseButtons怎么用?C# MouseButtons使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MouseButtons类属于命名空间,在下文中一共展示了MouseButtons类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GameButton

 public GameButton(Buttons buttonCode)
 {
     this.keyCode = Keys.None;
     this.mouseCode = MouseButtons.None;
     this.buttonCode = buttonCode;
     this.inputType = InputType.Button;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:7,代码来源:GameButton.cs

示例2: MouseMove

 public override void MouseMove(IPosition p, MouseButtons b)
 {
     if (b == MouseButtons.Left)
     {
         RectUpdate(p);
     }
 }
开发者ID:steve-stanton,项目名称:backsight,代码行数:7,代码来源:ZoomRectangleTool.cs

示例3: HandleMouseDown

		public override void HandleMouseDown(Point mousePos, MouseButtons mouseButtons)
		{
			int clickedVisibleLine = (mousePos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight;
			int lineNumber = textArea.Document.GetFirstLogicalLine(clickedVisibleLine);
			
			if ((mouseButtons & MouseButtons.Right) == MouseButtons.Right) {
				if (textArea.Caret.Line != lineNumber) {
					textArea.Caret.Line = lineNumber;
				}
			}
			
			IList<Bookmark> marks = textArea.Document.BookmarkManager.Marks;
			List<Bookmark> marksInLine = new List<Bookmark>();
			int oldCount = marks.Count;
			foreach (Bookmark mark in marks) {
				if (mark.LineNumber == lineNumber) {
					marksInLine.Add(mark);
				}
			}
			for (int i = marksInLine.Count - 1; i >= 0; i--) {
				Bookmark mark = marksInLine[i];
				if (mark.Click(textArea, new MouseEventArgs(mouseButtons, 1, mousePos.X, mousePos.Y, 0))) {
					if (oldCount != marks.Count) {
						textArea.UpdateLine(lineNumber);
					}
					return;
				}
			}
			base.HandleMouseDown(mousePos, mouseButtons);
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:30,代码来源:IconBarMargin.cs

示例4: LinkLabelLinkClickedEventArgs

		public LinkLabelLinkClickedEventArgs (LinkLabel.Link link)
		{
#if NET_2_0
			this.button = MouseButtons.Left;
#endif
			this.link = link;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:LinkLabelLinkClickedEventArgs.cs

示例5: SimulateClick

        // TODO:
        //public void SimulateScroll(int x, int y, int screenWidth, int screenHeight, scrollAmount)
        //public void SimulateScroll(scrollAmount)
        // TODO: Simulation which strips the ABSOLUTE factor from the mouse events, making the mouse NOT MOVE, for the click click.
        //public static void SimulateClick(MouseButtons mouseButton, int holdClickTime = 10)
        /// <summary>Simulates a mouse click at the specified location.</summary>
        /// <param name="x">The horizontal pixel coordinate to place the mouse cursor at.</param>
        /// <param name="y">The vertical pixel coordinate to place the mouse cursor at.</param>
        /// <param name="screenWidth">The current screen width (needed to scale the mouse cursor into position).</param>
        /// <param name="screenHeight">The current screen height (needed to scale the mouse cursor into position).</param>
        /// <param name="mouseButton">Which mouse button to simulate a click for.</param>
        /// <param name="holdClickTime">How long to simulate holding the mouse button down, in milliseconds.</param>
        /// <remarks>Basically this is just a pair of simulated mouse "down" and mouse "up" simulations in sequence.</remarks>
        public static void SimulateClick(int x, int y, int screenWidth, int screenHeight, MouseButtons mouseButton, int holdClickTime = 10)
        {
            VirtualMouseAction mouseDownOption, mouseUpOption;
            switch (mouseButton)
            {
                case MouseButtons.Left:
                    mouseDownOption = VirtualMouseAction.LeftButtonDown;
                    mouseUpOption = VirtualMouseAction.LeftButtonUp;
                    break;
                case MouseButtons.Middle:
                    mouseDownOption = VirtualMouseAction.MiddleButtonDown;
                    mouseUpOption = VirtualMouseAction.MiddleButtonUp;
                    break;
                case MouseButtons.Right:
                    mouseDownOption = VirtualMouseAction.RightButtonDown;
                    mouseUpOption = VirtualMouseAction.RightButtonUp;
                    break;
                default:
                    // TODO: Implement and test XButton1 and XButton2 with a fancy mouse.
                    throw new NotSupportedException("The selected mouse button is not yet supported: " + mouseButton.ToString());
            }

            Simulate(x, y, screenWidth, screenHeight, mouseDownOption);
            Thread.Sleep(holdClickTime);
            Simulate(x, y, screenWidth, screenHeight, mouseUpOption);
        }
开发者ID:KarakLive,项目名称:VirtualInput,代码行数:39,代码来源:VirtualMouse.cs

示例6: UpdateButtonState

        public void UpdateButtonState(MouseButtons button, ButtonState state)
        {
            if (button == MouseButtons.None || ButtonStates[button] == state && !_alwaysNotify) return;

            ButtonStates[button] = state;
            _doNotify = true;
        }
开发者ID:RuCaptain,项目名称:Neurolution,代码行数:7,代码来源:ControlStateListener.cs

示例7: MouseEventArgs

		public MouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta) {
			this.buttons=button;
			this.clicks=clicks;
			this.delta=delta;
			this.x=x;
			this.y=y;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:MouseEventArgs.cs

示例8: OnMouseUp

        private bool OnMouseUp(MouseButtons mouseButton,int shift,int x,int y)
        {
            if (this.TETool != null)
                this.TETool.OnMouseUp((int)System.Windows.Forms.MouseButtons.Right, shift, x,y);

            return true;
        }
开发者ID:hy1314200,项目名称:HyDM,代码行数:7,代码来源:TEHookHelper.cs

示例9: ClickPacket

 public ClickPacket(Point point, MouseButtons buttons, PressEvent pressEvent)
     : base(0x14)
 {
     Point = point;
     Buttons = buttons;
     PressEvent = pressEvent;
 }
开发者ID:rajeshwarn,项目名称:iDesktopVision,代码行数:7,代码来源:ClickPacket.cs

示例10: HandleMouseDown

        public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons)
        {
            try
            {
                bool showFolding = textArea.Document.TextEditorProperties.EnableFolding;
                int physicalLine = +(int)((mousepos.Y + textArea.VirtualTop.Y) / textArea.TextView.FontHeight);
                int realline = textArea.Document.GetFirstLogicalLine(physicalLine);

                // focus the textarea if the user clicks on the line number view
                textArea.Focus();

                if (!showFolding || realline < 0 || realline + 1 >= textArea.Document.TotalNumberOfLines)
                {
                    return;
                }

                List<FoldMarker> foldMarkers = textArea.Document.FoldingManager.GetFoldingsWithStart(realline);
                foreach (FoldMarker fm in foldMarkers)
                {
                    fm.IsFolded = !fm.IsFolded;
                }
                textArea.Document.FoldingManager.NotifyFoldingsChanged(EventArgs.Empty);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("in FoldMargin " + ex.Message);
            }
        }
开发者ID:pusp,项目名称:o2platform,代码行数:28,代码来源:FoldMargin.cs

示例11: base

	// Constructor.
	public StatusBarPanelClickEventArgs
				(StatusBarPanel statusBarPanel, MouseButtons button,
				 int clicks, int x, int y)
			: base(button, clicks, x, y, 0)
			{
				this.statusBarPanel = statusBarPanel;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:StatusBarPanelClickEventArgs.cs

示例12: OnMouseMove

 protected internal override void OnMouseMove(int X, int Y, MouseButtons mb)
 {
     if (Gumps.Capture == this)
     {
         Point point = ((Gump) this.m_Target).PointToScreen(new Point(0, this.m_Target.Height));
         Point point2 = base.PointToScreen(new Point(X, Y));
         int minWidth = ((point2.X - point.X) + 6) - this.m_xOffset;
         if (minWidth < this.m_Target.MinWidth)
         {
             minWidth = this.m_Target.MinWidth;
         }
         else if (minWidth > this.m_Target.MaxWidth)
         {
             minWidth = this.m_Target.MaxWidth;
         }
         bool flag = false;
         int num2 = point.Y - (point2.Y - this.m_yOffset);
         if (num2 < this.m_Target.MinHeight)
         {
             flag = true;
         }
         else if (num2 > this.m_Target.MaxHeight)
         {
             flag = true;
         }
         if (!flag)
         {
             this.m_Target.Height = num2;
             ((Gump) this.m_Target).Y = point2.Y - this.m_yOffset;
         }
         this.m_Target.Width = minWidth;
         Engine.Redraw();
     }
 }
开发者ID:Skinny1001,项目名称:PlayUO,代码行数:34,代码来源:GHTResizer.cs

示例13: Assign

        public DigitalButton Assign(MouseButtons button)
        {
            // Should it replace the assignment?
            this.mappingButtons.Add(button);

            return this;
        }
开发者ID:plaurin,项目名称:MonoGameEngine2D,代码行数:7,代码来源:DigitalButton.cs

示例14: DataListBeginDragEventArgs

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="source">The source data list for the drag and drop operation</param>
 /// <param name="start">The selection start</param>
 /// <param name="end">The selection end</param>
 /// <param name="mouseButtons">The mouse button used</param>
 public DataListBeginDragEventArgs(DataList source, int start, int end, MouseButtons mouseButtons)
 {
     this.Source = source;
     this.SelectionStart = start;
     this.SelectionEnd = end;
     this.Button = mouseButtons;
 }
开发者ID:modulexcite,项目名称:ListControls,代码行数:14,代码来源:DataListBeginDragEventArgs.cs

示例15: mouseLeftButton_MouseFirstPressed

 void mouseLeftButton_MouseFirstPressed(MouseButtons mouseButton, MouseState mouseState, GameTime gameTime)
 {
     if (Rec.Contains(UI.GameEngine.Controller.mousePositionPoint))
     {
         _prevSpeedFactor = Context.Map.SpeedFactor;
     }
 }
开发者ID:HaKDMoDz,项目名称:geff,代码行数:7,代码来源:BPMMeter.cs


注:本文中的MouseButtons类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。