本文整理汇总了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;
}
示例2: MouseMove
public override void MouseMove(IPosition p, MouseButtons b)
{
if (b == MouseButtons.Left)
{
RectUpdate(p);
}
}
示例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);
}
示例4: LinkLabelLinkClickedEventArgs
public LinkLabelLinkClickedEventArgs (LinkLabel.Link link)
{
#if NET_2_0
this.button = MouseButtons.Left;
#endif
this.link = link;
}
示例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);
}
示例6: UpdateButtonState
public void UpdateButtonState(MouseButtons button, ButtonState state)
{
if (button == MouseButtons.None || ButtonStates[button] == state && !_alwaysNotify) return;
ButtonStates[button] = state;
_doNotify = true;
}
示例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;
}
示例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;
}
示例9: ClickPacket
public ClickPacket(Point point, MouseButtons buttons, PressEvent pressEvent)
: base(0x14)
{
Point = point;
Buttons = buttons;
PressEvent = pressEvent;
}
示例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);
}
}
示例11: base
// Constructor.
public StatusBarPanelClickEventArgs
(StatusBarPanel statusBarPanel, MouseButtons button,
int clicks, int x, int y)
: base(button, clicks, x, y, 0)
{
this.statusBarPanel = statusBarPanel;
}
示例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();
}
}
示例13: Assign
public DigitalButton Assign(MouseButtons button)
{
// Should it replace the assignment?
this.mappingButtons.Add(button);
return this;
}
示例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;
}
示例15: mouseLeftButton_MouseFirstPressed
void mouseLeftButton_MouseFirstPressed(MouseButtons mouseButton, MouseState mouseState, GameTime gameTime)
{
if (Rec.Contains(UI.GameEngine.Controller.mousePositionPoint))
{
_prevSpeedFactor = Context.Map.SpeedFactor;
}
}