本文整理汇总了C#中MouseInputEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# MouseInputEventArgs类的具体用法?C# MouseInputEventArgs怎么用?C# MouseInputEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MouseInputEventArgs类属于命名空间,在下文中一共展示了MouseInputEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Device_MouseInput
void Device_MouseInput(object sender, MouseInputEventArgs e)
{
/*
if ((e.ButtonFlags & MouseButtonFlags.LeftDown) == MouseButtonFlags.LeftDown)
ButtonPressed(0);
else if ((e.ButtonFlags & MouseButtonFlags.LeftUp) == MouseButtonFlags.LeftUp)
ButtonReleased(0);
if ((e.ButtonFlags & MouseButtonFlags.RightDown) == MouseButtonFlags.RightDown)
ButtonPressed(1);
else if ((e.ButtonFlags & MouseButtonFlags.RightUp) == MouseButtonFlags.RightUp)
ButtonReleased(1);
if ((e.ButtonFlags & MouseButtonFlags.MiddleDown) == MouseButtonFlags.MiddleDown)
ButtonPressed(2);
else if ((e.ButtonFlags & MouseButtonFlags.MiddleUp) == MouseButtonFlags.MiddleUp)
ButtonReleased(2);
if ((e.ButtonFlags & MouseButtonFlags.Button4Down) == MouseButtonFlags.Button4Down)
ButtonPressed(3);
else if ((e.ButtonFlags & MouseButtonFlags.Button4Up) == MouseButtonFlags.Button4Up)
ButtonReleased(3);
if ((e.ButtonFlags & MouseButtonFlags.Button5Down) == MouseButtonFlags.Button5Down)
ButtonPressed(4);
else if ((e.ButtonFlags & MouseButtonFlags.Button5Up) == MouseButtonFlags.Button5Up)
ButtonReleased(4);
*/
mousePos.X += e.X;
mousePos.Y += e.Y;
}
示例2: UpdateInput
public void UpdateInput(object sender, MouseInputEventArgs e)
{
if (MouseMode != e.Mode)
e.Mode = MouseMode;
X -= e.X;
Y -= e.Y;
WheelDelta += e.WheelDelta;
if (e.ButtonFlags == MouseButtonFlags.LeftDown)
LeftButton = ButtonState.Pressed;
if (e.ButtonFlags == MouseButtonFlags.LeftUp)
LeftButton = ButtonState.Released;
if (e.ButtonFlags == MouseButtonFlags.RightDown)
RightButton = ButtonState.Pressed;
if (e.ButtonFlags == MouseButtonFlags.RightUp)
RightButton = ButtonState.Released;
if (e.ButtonFlags == MouseButtonFlags.MiddleDown)
MiddleButton = ButtonState.Pressed;
if (e.ButtonFlags == MouseButtonFlags.MiddleUp)
MiddleButton = ButtonState.Released;
if (e.ButtonFlags == MouseButtonFlags.Button4Down)
Button4 = ButtonState.Pressed;
if (e.ButtonFlags == MouseButtonFlags.Button4Up)
Button4 = ButtonState.Released;
if (e.ButtonFlags == MouseButtonFlags.Button5Down)
Button5 = ButtonState.Pressed;
if (e.ButtonFlags == MouseButtonFlags.Button5Up)
Button5 = ButtonState.Released;
}
示例3: MouseUp
public override bool MouseUp(MouseInputEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
return true;
}
return false;
}
示例4: mouse_MouseInput
void mouse_MouseInput(object sender, MouseInputEventArgs e)
{
buttonsLabel.Text = Enum.Format(typeof(MouseButtonFlags), e.ButtonFlags, "G");
extraLabel.Text = e.ExtraInformation.ToString(CultureInfo.CurrentCulture);
rawButtonsLabel.Text = e.RawButtons.ToString(CultureInfo.CurrentCulture);
locationLabel.Text = new Point(e.X, e.Y).ToString();
stateLabel.Text = Enum.Format(typeof(MouseMode), e.Mode, "G");
wheelLabel.Text = e.WheelDelta.ToString(CultureInfo.CurrentCulture);
}
示例5: MouseDown
public override bool MouseDown(MouseInputEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
ResetEntity();
return true;
}
return false;
}
示例6: MouseDown
public override bool MouseDown(MouseInputEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
if (Clicked != null) Clicked(this);
return true;
}
return false;
}
示例7: MouseUp
public override bool MouseUp(MouseInputEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)) &&
IoCManager.Resolve<IUserInterfaceManager>().DragInfo.IsActive)
{
if (Dropped != null) Dropped(this);
return true;
}
return false;
}
示例8: MouseDown
public override bool MouseDown(MouseInputEventArgs e)
{
if (!Available) return false;
if (_buttonArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
if (Clicked != null) Clicked(this);
Selected = true;
return true;
}
return false;
}
示例9: MouseUp
public override bool MouseUp(MouseInputEventArgs e)
{
if (ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
if (_userInterfaceManager.DragInfo.IsEntity && _userInterfaceManager.DragInfo.IsActive)
{
SetEntity(_userInterfaceManager.DragInfo.DragEntity);
_userInterfaceManager.DragInfo.Reset();
return true;
}
}
return false;
}
示例10: MouseDown
public override bool MouseDown(MouseInputEventArgs e)
{
if (!IsVisible()) return false;
if (clientAreaButton.Contains((int) e.Position.X, (int) e.Position.Y))
{
dragging = true;
return true;
}
else if (ClientArea.Contains((int) e.Position.X, (int) e.Position.Y))
{
return true;
}
return false;
}
示例11: Device_MouseInput
public void Device_MouseInput(object sender, MouseInputEventArgs e)
{
MousePoint = form.PointToClient(Cursor.Position);
_mouseDelta.X = e.X;
_mouseDelta.Y = e.Y;
MouseWheelDelta = e.WheelDelta;
if (e.ButtonFlags == MouseButtonFlags.None)
return;
MouseButtonFlags mouseFlags = e.ButtonFlags;
// Don't consider mouse clicks outside of the client area
if (form.Focused == false || form.ClientRectangle.Contains(MousePoint) == false)
mouseFlags &= ~(MouseButtonFlags.LeftDown | MouseButtonFlags.RightDown);
// Find the pressed/unpressed keys
if (mouseFlags == MouseButtonFlags.LeftDown)
{
if ((MouseDown & MouseButtonFlags.LeftDown) != MouseButtonFlags.LeftDown)
{
MouseDown |= MouseButtonFlags.LeftDown;
MousePressed |= MouseButtonFlags.LeftDown;
}
}
else if (mouseFlags == MouseButtonFlags.LeftUp)
{
MouseDown &= ~MouseButtonFlags.LeftDown;
MousePressed |= MouseButtonFlags.LeftUp;
}
if (mouseFlags == MouseButtonFlags.RightDown)
{
if ((MouseDown & MouseButtonFlags.RightDown) != MouseButtonFlags.RightDown)
{
MouseDown |= MouseButtonFlags.RightDown;
MousePressed |= MouseButtonFlags.RightDown;
}
}
else if (mouseFlags == MouseButtonFlags.RightUp)
{
MouseDown &= ~MouseButtonFlags.RightDown;
MousePressed |= MouseButtonFlags.RightUp;
}
}
示例12: MouseDown
public override bool MouseDown(MouseInputEventArgs e)
{
if (disposing || !IsVisible()) return false;
if (closeButton.MouseDown(e)) return true;
if (base.MouseDown(e)) return true;
if (titleArea.Contains((int) e.Position.X, (int) e.Position.Y))
{
draggingOffset.X = (int) e.Position.X - Position.X;
draggingOffset.Y = (int) e.Position.Y - Position.Y;
dragging = true;
return true;
}
return false;
}
示例13: MouseEventHandle
public void MouseEventHandle(object sender, MouseInputEventArgs e)
{
mouseDelta.X += e.X;
mouseDelta.Y += e.Y;
}
示例14: MouseWheelMove
public override bool MouseWheelMove(MouseInputEventArgs e)
{
var modArgs = new MouseInputEventArgs
(e.Buttons,
e.ShiftButtons,
new Vector2D(e.Position.X - Position.X + scrollbarH.Value, e.Position.Y - Position.Y + scrollbarV.Value),
e.WheelPosition,
e.RelativePosition,
e.WheelDelta,
e.ClickCount);
if (inner_focus != null)
{
if (inner_focus.MouseWheelMove(modArgs))
return true;
else if (scrollbarV.IsVisible() && ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
scrollbarV.MouseWheelMove(e);
return true;
}
}
else if (scrollbarV.IsVisible() && ClientArea.Contains(new Point((int) e.Position.X, (int) e.Position.Y)))
{
scrollbarV.MouseWheelMove(e);
return true;
}
return false;
}
示例15: MouseMove
public override void MouseMove(MouseInputEventArgs e)
{
if (disposing || !IsVisible()) return;
scrollbarH.MouseMove(e);
scrollbarV.MouseMove(e);
var modArgs = new MouseInputEventArgs
(e.Buttons,
e.ShiftButtons,
new Vector2D(e.Position.X - Position.X + scrollbarH.Value, e.Position.Y - Position.Y + scrollbarV.Value),
e.WheelPosition,
e.RelativePosition,
e.WheelDelta,
e.ClickCount);
foreach (GuiComponent component in components)
component.MouseMove(modArgs);
return;
}