InputEventMouse
Common mouse-event base: points and a button mask.
Use a concrete InputEventMouseButton or InputEventMouseMotion. The base type combines Position, GlobalPosition and ButtonMask. These are event data, not a cursor-movement command.
Delivery to Control converts Position into its local space. For example, without additional transforms, a control positioned at (40, 30) receives a click at (50, 40) with local Position = (10, 10), while stored GlobalPosition remains (50, 40). With scaling, canvas transforms or SubViewport, choose the required conversion explicitly instead of substituting GlobalPosition because of its name.
ButtonMask combines held-button bits; the button subclass's ButtonIndex identifies one event. The two enums are not interchangeable.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties3
ButtonMaskProperty
public MouseButtonMask ButtonMask { get; set; }MouseButtonMask bit combination for buttons held together. An empty mask is 0. This is separate data from the event's ButtonIndex; assigning one field does not automatically derive the other.
GlobalPositionProperty
public Vector2 GlobalPosition { get; set; }Stored common event point. Mouse button and motion XformedBy preserve it while transforming Position. Do not interpret Global as an Entity2D world position or an absolute desktop point: its space depends on delivery through the Viewport and canvas.
PositionProperty
public Vector2 Position { get; set; }Point in the event recipient's space. _Input uses Viewport space; delivery to Control.GuiInput uses Control-local coordinates. XformedBy transforms this point including translation. It is neither Relative displacement nor guaranteed OS coordinates.
Methods6
GetButtonMaskMouseButtonMask
public MouseButtonMask GetButtonMask();Returns ButtonMask from the event without polling the device again.
MouseButtonMaskCurrent ButtonMask value in the property's space and units.
GetGlobalPositionVector2
public Vector2 GetGlobalPosition();Returns GlobalPosition from the event without polling the device again.
Vector2Current GlobalPosition value in the property's space and units.
GetPositionVector2
public Vector2 GetPosition();Returns Position from the event without polling the device again.
Vector2Current Position value in the property's space and units.
SetButtonMaskvoid
public void SetButtonMask(MouseButtonMask buttonMask);Sets ButtonMask using the property rules; neither moves the OS pointer nor submits input.
| Name | Type | Default |
|---|---|---|
buttonMask | MouseButtonMask | — |
buttonMaskNew ButtonMask value.
SetGlobalPositionvoid
public void SetGlobalPosition(Vector2 globalPosition);Sets GlobalPosition using the property rules; neither moves the OS pointer nor submits input.
| Name | Type | Default |
|---|---|---|
globalPosition | Vector2 | — |
globalPositionNew GlobalPosition value.
SetPositionvoid
public void SetPosition(Vector2 position);Sets Position using the property rules; neither moves the OS pointer nor submits input.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
positionNew Position value.