Gorgon
Show / Hide Table of Contents

Interface IGorgonMouse

Provides events and state for mouse data from a physical mouse.

Inherited Members
IGorgonRawInputDevice.Handle
IGorgonRawInputDevice.DeviceType
IGorgonRawInputDevice.DeviceUsage
IGorgonRawInputDeviceData<GorgonRawMouseData>.ProcessData(in GorgonRawMouseData)
Namespace: Gorgon.Input
Assembly: Gorgon.Input.dll
Syntax
public interface IGorgonMouse : IGorgonRawInputDevice, IGorgonRawInputDeviceData<GorgonRawMouseData>

Properties

| Edit this page View Source

Buttons

Property to set or return the pointing device button(s) that are currently down.

Declaration
MouseButtons Buttons { get; set; }
Property Value
Type Description
MouseButtons
| Edit this page View Source

DoubleClickDelay

Property to set or return the delay between button clicks, in milliseconds, for a double click event.

Declaration
int DoubleClickDelay { get; set; }
Property Value
Type Description
int
| Edit this page View Source

DoubleClickSize

Property to set or return the Size of the area, in pixels, surrounding the cursor that represents a valid double click area.

Declaration
Size2 DoubleClickSize { get; set; }
Property Value
Type Description
Size2
Remarks

When this value is set, and a mouse button is double clicked, this value is checked to see if the mouse Position falls within -value.Size.Width to value.Size.Width, and -value.Size.Height" to value.Size.Height on the second click. If the Position is within this area, then the double click event will be triggered. Otherwise, it will not.

Passing Size.Empty to this property will disable double clicking.

| Edit this page View Source

Info

Property to return information about this mouse.

Declaration
IGorgonMouseInfo Info { get; }
Property Value
Type Description
IGorgonMouseInfo
| Edit this page View Source

Position

Property to set or return the position of the mouse.

Declaration
Point Position { get; set; }
Property Value
Type Description
Point
Remarks

This property is affected by the PositionConstraint value.

| Edit this page View Source

PositionConstraint

Property to set or return the Rectangle used to constrain the mouse Position.

Declaration
Rectangle PositionConstraint { get; set; }
Property Value
Type Description
Rectangle
Remarks

This will constrain the value of the Position within the specified Rectangle. This means that a cursor positioned at 320x200 with a region located at 330x210 with a width and height of 160x160 will make the Position property return 330x210. If the cursor was positioned at 500x400, the Position property would return 480x360.

Passing Rectangle.Empty to this property will remove the constraint on the position.

| Edit this page View Source

RelativePositionOffset

Property to set or return the last reported relative position movement offset.

Declaration
Point RelativePositionOffset { get; set; }
Property Value
Type Description
Point
Remarks

This value represents the number of units that the mouse moved since its last MouseMove event.

Users should reset this value when they are done with it. Otherwise, it will not be reset until the next MouseWheelMove event.

| Edit this page View Source

RelativeWheelDelta

Property to set or return the last reported relative wheel movement delta.

Declaration
int RelativeWheelDelta { get; set; }
Property Value
Type Description
int
Remarks

This value represents the number of units that the mouse wheel moved since its last MouseWheelMove event.

Users should reset this value when they are done with it. Otherwise, it will not be reset until the next MouseWheelMove event.

| Edit this page View Source

WheelConstraint

Property to set or return the GorgonRange used to constrain the mouse WheelPosition.

Declaration
GorgonRange WheelConstraint { get; set; }
Property Value
Type Description
GorgonRange
Remarks

If a mouse wheel exists on the device, this will constrain the value of the WheelPosition within the specified GorgonRange. This means that a wheel with a position of 160, with a constraint of 180-190 will make the WheelPosition property return 180.

Passing Empty to this property will remove the constraint on the position.

| Edit this page View Source

WheelPosition

Property to set or return the pointing device wheel position.

Declaration
int WheelPosition { get; set; }
Property Value
Type Description
int
Remarks

This property is affected by the WheelConstraint value.

Events

| Edit this page View Source

MouseButtonDown

Event triggered when a mouse button is held down.

Declaration
event EventHandler<GorgonMouseEventArgs> MouseButtonDown
Event Type
Type Description
EventHandler<GorgonMouseEventArgs>
| Edit this page View Source

MouseButtonUp

Event triggered when a mouse button is released.

Declaration
event EventHandler<GorgonMouseEventArgs> MouseButtonUp
Event Type
Type Description
EventHandler<GorgonMouseEventArgs>
| Edit this page View Source

MouseDoubleClicked

Event triggered when a double click is performed on a mouse button.

Declaration
event EventHandler<GorgonMouseEventArgs> MouseDoubleClicked
Event Type
Type Description
EventHandler<GorgonMouseEventArgs>
| Edit this page View Source

MouseMove

Event triggered when the mouse is moved.

Declaration
event EventHandler<GorgonMouseEventArgs> MouseMove
Event Type
Type Description
EventHandler<GorgonMouseEventArgs>
| Edit this page View Source

MouseWheelMove

Event triggered when a mouse wheel (if present) is moved.

Declaration
event EventHandler<GorgonMouseEventArgs> MouseWheelMove
Event Type
Type Description
EventHandler<GorgonMouseEventArgs>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author