Table of Contents

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 : EventArgs

Inheritance

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

button MouseButton

Mouse button.

x int

X coordinate.

y int

Y coordinate.

alt bool

Alt state.

ctrl bool

Ctrl state.

shift bool

Shift state.

Properties

Alt

Gets a value indicating whether the Alt key was pressed during the mouse event.

public bool Alt { get; }

Property Value

bool

Button

Gets the mouse button that was pressed or released.

public MouseButton Button { get; }

Property Value

MouseButton

Ctrl

Gets a value indicating whether the Ctrl key was pressed during the mouse event.

public bool Ctrl { get; }

Property Value

bool

Shift

Gets a value indicating whether the Shift key was pressed during the mouse event.

public bool Shift { get; }

Property Value

bool

X

Gets the X coordinate of the mouse pointer.

public int X { get; }

Property Value

int

Y

Gets the Y coordinate of the mouse pointer.

public int Y { get; }

Property Value

int