Class MouseEventArgsEx
- Namespace
- VisioForge.Core.Types.Events
- Assembly
- VisioForge.Core.dll
Provides extended data for mouse events within video views and media controls. This event args class includes information about mouse position, button state, and keyboard modifiers.
public class MouseEventArgsEx : EventArgsInheritance
Inherited Members
Examples
// Example of handling mouse events on a video view
videoView.OnMouseButtonDown += (sender, e) =>
{
// Check for left-click with Ctrl held
if (e.Button == MouseButton.Left && e.Ctrl)
{
// Add a marker at this position
AddVideoMarker(e.X, e.Y);
}
// Check for right-click
else if (e.Button == MouseButton.Right)
{
// Show context menu
ShowVideoContextMenu(e.X, e.Y);
}
};
// Example of implementing video region selection
private Point? selectionStart;
videoView.OnMouseButtonDown += (sender, e) =>
{
if (e.Button == MouseButton.Left && e.Shift)
{
// Start selection
selectionStart = new Point(e.X, e.Y);
}
};
videoView.OnMouseButtonUp += (sender, e) =>
{
if (e.Button == MouseButton.Left && selectionStart.HasValue)
{
// Complete selection
var selectionEnd = new Point(e.X, e.Y);
CreateVideoRegion(selectionStart.Value, selectionEnd);
selectionStart = null;
}
};
Remarks
This extended mouse event args class is used in video rendering controls to provide detailed information about mouse interactions, including modifier key states. The coordinates are relative to the video view control's client area.
Constructors
MouseEventArgsEx(MouseButton, int, int, bool, bool, bool)
Initializes a new instance of the VisioForge.Core.Types.Events.MouseEventArgsEx class.
public MouseEventArgsEx(MouseButton button, int x, int y, bool alt, bool ctrl, bool shift)Parameters
buttonMouseButton-
Mouse button.
xint-
X coordinate.
yint-
Y coordinate.
altbool-
Alt state.
ctrlbool-
Ctrl state.
shiftbool-
Shift state.
Properties
Alt
Gets a value indicating whether the Alt key was pressed during the mouse event.
public bool Alt { get; }Property Value
Button
Gets the mouse button that was pressed or released.
public MouseButton Button { get; }Property Value
Ctrl
Gets a value indicating whether the Ctrl key was pressed during the mouse event.
public bool Ctrl { get; }Property Value
Shift
Gets a value indicating whether the Shift key was pressed during the mouse event.
public bool Shift { get; }Property Value
X
Gets the X coordinate of the mouse pointer.
public int X { get; }Property Value
Y
Gets the Y coordinate of the mouse pointer.
public int Y { get; }