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


C# Input.MouseButtonEventArgs类代码示例

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


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

示例1: ProcessMouse

		public static void ProcessMouse(int oriX,int oriY){
			
			EventArgs evnt=null;
			var pressed = false;
			prevMouseState =curMouseState;
			curMouseState = Mouse.GetCursorState ();
            Gwen.Input.InputHandler.HoveredControl =input.m_Canvas.GetControlAt(curMouseState.X - oriX, curMouseState.Y - oriY);
            foreach (var mouseCode in mouseCodes)
				if (curMouseState[mouseCode]!=prevMouseState[mouseCode]){
                    evnt = new MouseButtonEventArgs(curMouseState.X - oriX, curMouseState.Y - oriY, mouseCode, true);//last param bugged
                    //evnt = new MouseButtonEventArgs (curMouseState.X, curMouseState.Y, mouseCode,true);//last param bugged
					if (curMouseState [mouseCode]) {
						pressed = true;
                        Gwen.Input.InputHandler.MouseFocus = Gwen.Input.InputHandler.HoveredControl;
                        OnMouseDown?.Invoke ((MouseButtonEventArgs)evnt);
					} else {
						OnMouseUp?.Invoke ((MouseButtonEventArgs)evnt);

					}
				}
			Vector2 delta =MainWindow.lastPos - new Vector2(curMouseState.X, curMouseState.Y);
			if (Math.Abs (delta.X) > 0 || Math.Abs (delta.Y) > 0) {
				
				evnt = new MouseMoveEventArgs (curMouseState.X-oriX, curMouseState.Y-oriY,(int)delta.X,(int)delta.Y);
				OnMouseMove?.Invoke (evnt as MouseMoveEventArgs);
			}
			input.ProcessMouseMessage (evnt,pressed);
			MainWindow.lastPos = new Vector2 (curMouseState.X, curMouseState.Y);
		}
开发者ID:BreyerW,项目名称:Sharp.Engine,代码行数:29,代码来源:InputHandler.cs

示例2: MouseUp

        public void MouseUp(MouseButtonEventArgs args)
        {
            if (Interfaces.ContainsKey (lastState)) {

                Interfaces [lastState].MouseUp(args);
            }
        }
开发者ID:pdabbadabba,项目名称:Beatdown,代码行数:7,代码来源:GUI.cs

示例3: MouseButtonDown

 public void MouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (!Main.Focused)
     {
         return;
     }
 }
开发者ID:Azzi777,项目名称:Umbra-Voxel-Engine,代码行数:7,代码来源:Overlay.cs

示例4: _ButtonDown

 private void _ButtonDown(object sender, MouseButtonEventArgs arguments)
 {
     if (!_window.Focused) return;
     _downButtons.Add((Button)arguments.Button);
     if(ButtonDown != null)
         ButtonDown(sender, new DunamisMouseButtonEventArgs((Button)arguments.Button));
 }
开发者ID:killowatt,项目名称:Dunamis,代码行数:7,代码来源:Mouse.cs

示例5: Mouse_ButtonDown

 void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (e.Button == MouseButton.Left)
     {
         AddLine(e.X, e.Y);
     }
 }
开发者ID:RetroAchievements,项目名称:opentk,代码行数:7,代码来源:MouseCursorSimple.cs

示例6: OnRaycastHitchanged

        public bool OnRaycastHitchanged(Input input, QbMatrix matrix, RaycastHit hit, ref Colort color, MouseButtonEventArgs e)
        {
            if ((e != null && e.IsPressed && e.Button == MouseButton.Left) || (e == null && input.mousedown(MouseButton.Left)))
            {
                QbMatrix mat = Singleton<QbManager>.INSTANCE.ActiveModel.matrices[hit.matrixIndex];
                if (mat != null)
                {
                    Voxel voxel;
                    if (mat.voxels.TryGetValue(mat.GetHash(hit.x, hit.y, hit.z), out voxel))
                    {
                        for (int i = 0; i < 10; i++)
                        {
                            var colorpal = Singleton<GUI>.INSTANCE.Get<EmptyWidget>(GUIID.START_COLOR_SELECTORS + i);

                            if ((bool)colorpal.customData["active"])
                            {
                                colorpal.appearence.Get<PlainBackground>("background").color = mat.colors[voxel.colorindex];
                                Singleton<GUI>.INSTANCE.Dirty = true;

                                Singleton<BrushManager>.INSTANCE.brushColor = mat.colors[voxel.colorindex];

                                Color4 colorr = mat.colors[voxel.colorindex];
                                Singleton<Broadcaster>.INSTANCE.Broadcast(Message.ColorSelectionChanged, colorpal, colorr);
                            }
                        }
                    }
                }
                return true;
            }
            return false;
        }
开发者ID:law4x,项目名称:stonevox3d,代码行数:31,代码来源:BrushColorSelection.cs

示例7: Mouse_ButtonDown

 void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
 {
     for (Int16 i = 0; i < 6; i++)
     {
         if ((e.X > menuVects[i][0].X && e.X < menuVects[i][1].X) && ((Settings.Height - e.Y) > menuVects[i][0].Y && (Settings.Height - e.Y) < menuVects[i][2].Y))
         {
             switch (i)
             {
                 case 0: //Singleplayer clicked
                     ScreenManager.Push(new Screens.Singleplayer());
                     break;
                 case 1: //Multiplayer clicked
                     ScreenManager.Push(new Screens.Multiplayer());
                     break;
                 case 2: //Texture Packs clicked
                     break;
                 case 3: //Mods clicked
                     break;
                 case 4: //Options clicked
                     break;
                 case 5: //Exit clicked
                     Program.Close();
                     break;
             }
         }
     }
 }
开发者ID:White-Wolf,项目名称:Minesharp,代码行数:27,代码来源:MainMenu.cs

示例8: OpenGLDisplay_MouseDown

		private void OpenGLDisplay_MouseDown( object sender, MouseButtonEventArgs e )
		{
			_mouse_x = 0;
			_mouse_y = 0;
			System.Windows.Forms.Cursor.Position = new System.Drawing.Point( X + ( Width ) / 2, Y + Height / 2 );
			HiddenMouse = true;
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:7,代码来源:OpenGLDisplay.cs

示例9: Mouse_ButtonUp

 void Mouse_ButtonUp(object sender, MouseButtonEventArgs e)
 {
     md.X = e.X; md.Y = e.Y;
     md[e.Button] = false;
     md.Button = e.Button;
     app.MouseUp(sender, md);
 }
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:7,代码来源:Standalone.cs

示例10: Mouse_ButtonDown

 void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
 {
     md.X = e.X; md.Y = e.Y;
     md[e.Button] = true;
     md.Button = e.Button;
     app.MouseDown(sender, md);
 }
开发者ID:petya2164,项目名称:ZsharpGameEditor,代码行数:7,代码来源:Standalone.cs

示例11: Mouse_ButtonDown

        private void Mouse_ButtonDown(object sender, MouseButtonEventArgs ea)
        {
            isDragging = true;
            mousePos = MousePos;
            if (mousePos.ModulusSquared > 0.98)
                isDraggingAngle = true;

            initialMousePos = mousePos;
        }
开发者ID:bcourter,项目名称:Sunflower,代码行数:9,代码来源:MouseControl.cs

示例12: onDown

		void onDown (object sender, MouseButtonEventArgs e)
		{
			decimal tmp = 0;
			if (!decimal.TryParse (l.Text, out tmp))
				return;

			tmp -= 1;
			l.Text = tmp.ToString ();
		}
开发者ID:jpbruyere,项目名称:Crow,代码行数:9,代码来源:GOLIBTest_deviceOffset.cs

示例13: MouseDown

        public override void MouseDown(MouseButtonEventArgs e)
        {
            base.MouseDown(e);

            if (this.IsMouseOver())
            {
                SetChecked(!this.IsChecked);
            }
        }
开发者ID:Foohy,项目名称:OlegEngine,代码行数:9,代码来源:CheckBox.cs

示例14: OnMouseDown

 protected override void OnMouseDown(MouseButtonEventArgs e)
 {
     if (e.Button == MouseButton.Right)
     {
         _move = e.IsPressed;
         _moveFocusX = e.X;
         _moveFocusY = e.Y;
     }
     base.OnMouseDown(e);
 }
开发者ID:ikkentim,项目名称:PythagorasTree,代码行数:10,代码来源:PythagorasWindow.cs

示例15: OnMouseUp

 protected override void OnMouseUp(MouseButtonEventArgs e)
 {
     if (e.Button == MouseButton.Right)
     {
         _move = e.IsPressed;
         Rescale();
         CalcData();
     }
     base.OnMouseUp(e);
 }
开发者ID:ikkentim,项目名称:PythagorasTree,代码行数:10,代码来源:PythagorasWindow.cs


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