本文整理汇总了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);
}
示例2: MouseUp
public void MouseUp(MouseButtonEventArgs args)
{
if (Interfaces.ContainsKey (lastState)) {
Interfaces [lastState].MouseUp(args);
}
}
示例3: MouseButtonDown
public void MouseButtonDown(object sender, MouseButtonEventArgs e)
{
if (!Main.Focused)
{
return;
}
}
示例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));
}
示例5: Mouse_ButtonDown
void Mouse_ButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.Button == MouseButton.Left)
{
AddLine(e.X, e.Y);
}
}
示例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;
}
示例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;
}
}
}
}
示例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;
}
示例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);
}
示例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);
}
示例11: Mouse_ButtonDown
private void Mouse_ButtonDown(object sender, MouseButtonEventArgs ea)
{
isDragging = true;
mousePos = MousePos;
if (mousePos.ModulusSquared > 0.98)
isDraggingAngle = true;
initialMousePos = mousePos;
}
示例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 ();
}
示例13: MouseDown
public override void MouseDown(MouseButtonEventArgs e)
{
base.MouseDown(e);
if (this.IsMouseOver())
{
SetChecked(!this.IsChecked);
}
}
示例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);
}
示例15: OnMouseUp
protected override void OnMouseUp(MouseButtonEventArgs e)
{
if (e.Button == MouseButton.Right)
{
_move = e.IsPressed;
Rescale();
CalcData();
}
base.OnMouseUp(e);
}