Mouse event arguments.
Constructors
MouseEventArgs
#public MouseEventArgs(MouseButtons buttons, Keys modifiers, PointF location, SizeF? delta = null, float pressure = 1)
Initializes a new instance of the MouseEventArgs class.
Parameters:
| buttons (MouseButtons) | Buttons involved in the event. |
| modifiers (Keys) | Key modifiers such as Control, Alt, or Shift. |
| location (PointF) | Location of the mouse cursor for the event. |
| delta (SizeF? = null) | Delta of the scroll wheel. |
| pressure (float = 1) | Pressure of a stylus or touch, if applicable. 1.0f for full pressure or not supported |
Initializes a new instance of the MouseEventArgs class.
Parameters:
| buttons (MouseButtons) | Buttons involved in the event. |
| modifiers (Keys) | Key modifiers such as Control, Alt, or Shift. |
| location (PointF) | Location of the mouse cursor for the event. |
| delta (SizeF?) | Delta of the scroll wheel. |
| pressure (float) | Pressure of a stylus or touch, if applicable. 1.0f for full pressure or not supported |
| isDirectionInverted (bool) | Whether the delta is inverted from the direction of the physical device. |
Properties
Delta
#Gets or sets the delta change of the scroll wheel for the event.
Value: The scroll wheel delta.
Handled
#Gets or sets a value indicating whether the event is handled.
Remarks: Set this to true if you perform logic with the event and wish the default event to be cancelled. Some platforms may cause audio feedback if the user's action does not perform anything.
Value:
true if handled; otherwise, false.Gets a value indicating that the Delta is inverted from the direction of the physical device.
Remarks:
This is true when the user has turned on natural (or reverse) scrolling for the device that generated the event, in which case the platform has already flipped the Delta so that the content follows the user's fingers. Use this when you need to move something with the device instead of with the content, such as panning a canvas with a two finger scroll.
Only wheel events report this, and only on platforms that expose the setting per event (currently macOS via NSEvent.isDirectionInvertedFromDevice). Elsewhere this is always false, as the platform gives no way to tell an inverted delta from a regular one.
Value:
true if the delta is inverted from the device; otherwise, false.Location
#Gets the location of the mouse relative to the control that raised the event.
Value: The location of the mouse cursor.
Modifiers
#Pressure
#Gets or sets the pressure of the mouse/stylus press, if applicable. 1.0 if full pressure or not supported.
Value: The pressure of the mouse/stylus.