This documentation is archived and is not being maintained.

MouseDevice Class

Represents a mouse device.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public abstract class MouseDevice : InputDevice

The MouseDevice type exposes the following members.

Public propertyActiveSourceGets the PresentationSource that is reporting input for this device. (Overrides InputDevice.ActiveSource.)
Public propertyCapturedGets the IInputElement that is captured by the mouse.
Public propertyDirectlyOverGets the element that the mouse pointer is directly over.
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public propertyLeftButtonGets the state of the left mouse button of this mouse device.
Public propertyMiddleButton The state of the middle button of this mouse device.
Public propertyOverrideCursorGets or sets the cursor for the entire application.
Public propertyRightButtonGets the state of the right button of this mouse device.
Public propertyTargetGets the IInputElement that the input from this mouse device is sent to. (Overrides InputDevice.Target.)
Public propertyXButton1Gets the state of the first extended button on this mouse device.
Public propertyXButton2Gets the state of the second extended button of this mouse device.

Public methodCapture(IInputElement)Captures mouse events to the specified element.
Public methodCapture(IInputElement, CaptureMode)Captures mouse input to the specified element using the specified CaptureMode.
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGetButtonStateGets the state of the specified mouse button.
Protected methodGetClientPosition()Calculates the position of the mouse pointer, in client coordinates.
Protected methodGetClientPosition(PresentationSource)Calculates the position of the mouse pointer, in client coordinates, in the specified PresentationSource.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetPositionGets the position of the mouse relative to a specified element.
Protected methodGetScreenPositionCalculates the screen position of the mouse pointer.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSetCursorSets the mouse pointer to the specified Cursor
Public methodSynchronizeForces the mouse to resynchronize.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUpdateCursorForces the mouse cursor to update.
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)

The MouseDevice supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

For mouse related input, use the Mouse class. The Mouse class represents the mouse to an application and provides methods, properties, and events that reflect the state of the mouse.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.