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


C# MouseButtons.HasFlag方法代码示例

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


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

示例1: Up

 public static void Up(int x, int y, MouseButtons buttons)
 {
     Move(x, y);
     MouseEventFlags flags = 0;
     if (buttons.HasFlag(MouseButtons.Left)) { flags |= MouseEventFlags.LeftUp; }
     if (buttons.HasFlag(MouseButtons.Middle)) { flags |= MouseEventFlags.MiddleUp; }
     if (buttons.HasFlag(MouseButtons.Right)) { flags |= MouseEventFlags.RightUp; }
     MouseEvent(flags, new Point(x, y));
 }
开发者ID:darkguy2008,项目名称:FreeRDC,代码行数:9,代码来源:RDCRemoteMouse.cs

示例2: MouseUpHandler

        void MouseUpHandler(object sender, MouseEventArgs e)
        {
            pressedMouseButtons &= ~e.Button;

            if (!pressedMouseButtons.HasFlag(MouseButtons.Left | MouseButtons.Right))
            {
                dragging = false;
                Child.Cursor = Cursors.Arrow;
            }

            if (!wasDragging) Mode.MouseClicked(new Vector2(e.X,e.Y));
            if (pressedMouseButtons == MouseButtons.None) wasDragging = false;
        }
开发者ID:Artentus,项目名称:GameUtils,代码行数:13,代码来源:MeshEditor.cs

示例3: GetButtonsFromNative

 /// <summary>
 /// Gets the equivalent <see cref="T:DesktopSprites.SpriteManagement.SimpleMouseButtons"/> enumeration from the native button
 /// enumeration.
 /// </summary>
 /// <param name="buttons">The <see cref="T:System.Windows.Forms.MouseButtons"/> enumeration of the mouse button that was pressed.
 /// </param>
 /// <returns>The equivalent <see cref="T:DesktopSprites.SpriteManagement.SimpleMouseButtons"/> enumeration for this button.
 /// </returns>
 private static SimpleMouseButtons GetButtonsFromNative(MouseButtons buttons)
 {
     SimpleMouseButtons simpleButtons = SimpleMouseButtons.None;
     if (buttons.HasFlag(MouseButtons.Left))
         simpleButtons |= SimpleMouseButtons.Left;
     if (buttons.HasFlag(MouseButtons.Right))
         simpleButtons |= SimpleMouseButtons.Right;
     if (buttons.HasFlag(MouseButtons.Middle))
         simpleButtons |= SimpleMouseButtons.Middle;
     return simpleButtons;
 }
开发者ID:jokester,项目名称:Desktop-Ponies,代码行数:19,代码来源:WinFormSpriteInterface.cs

示例4: MouseDownHandler

        void MouseDownHandler(object sender, MouseEventArgs e)
        {
            pressedMouseButtons |= e.Button;

            if (pressedMouseButtons.HasFlag(MouseButtons.Left | MouseButtons.Right))
            {
                dragging = true;
                wasDragging = true;
                oldMouseX = e.X;
                oldMouseY = e.Y;
                Child.Cursor = grabbingCursor;
            }
        }
开发者ID:Artentus,项目名称:GameUtils,代码行数:13,代码来源:MeshEditor.cs


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