Class Mouse
Represents a single hardware mouse device. Used by the Input to report raw mouse input events.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class Mouse : InputDevice
Remarks
The mouse device position is in screen-space (not game client window space).
Constructors
Mouse()
Properties
IsAnyButtonDown
Checks if any mouse button is currently pressed.
Declaration
[Unmanaged]
public bool IsAnyButtonDown { get; }
Property Value
System.Boolean
|
Position
Gets the position of the mouse in the screen-space coordinates.
Declaration
[Unmanaged]
public Float2 Position { get; }
Property Value
Float2
|
PositionDelta
Gets the delta position of the mouse in the screen-space coordinates.
Declaration
[Unmanaged]
public Float2 PositionDelta { get; }
Property Value
Float2
|
ScrollDelta
Gets the mouse wheel change during the last frame.
Declaration
[Unmanaged]
public float ScrollDelta { get; }
Property Value
System.Single
|
Methods
GetButton(MouseButton)
Gets the mouse button state (true if being pressed during the current frame).
Declaration
[Unmanaged]
public bool GetButton(MouseButton button)
Parameters
MouseButton
button
Mouse button to check |
Returns
System.Boolean
True if user holds down the button, otherwise false. |
GetButtonDown(MouseButton)
Gets the mouse button down state (true if was pressed during the current frame).
Declaration
[Unmanaged]
public bool GetButtonDown(MouseButton button)
Parameters
MouseButton
button
Mouse button to check |
Returns
System.Boolean
True if user starts pressing down the button, otherwise false. |
GetButtonUp(MouseButton)
Gets the mouse button up state (true if was released during the current frame).
Declaration
[Unmanaged]
public bool GetButtonUp(MouseButton button)
Parameters
MouseButton
button
Mouse button to check |
Returns
System.Boolean
True if user releases the button, otherwise false. |