PowerQuest 0.20.10
Loading...
Searching...
No Matches
QuestMouse Class Reference

Detailed Description

Quest Mouse provides functions to access mouse input, while allowing the input system being used to change when necessary.

eg. if ( QuestMouse.LeftButtonUp ) Display: The player left clicked.

Advanced: Use an alternative input system by implementing the IQuestMouseHandler function and calling QuestMouse.SetHandler<MyOwnInputSystem>();

Properties

static IQuestMouseHandler Handler [get]
 
static Vector2 mousePosition [get]
 The current mouse position in pixel coordinates. (Read Only).
 
static Vector2 mousePositionDelta [get]
 The change in mouse position since last frame in pixel coordinates. (Unity 2022.2 and later only) (Read Only).
 
static Vector2 mouseScrollDelta [get]
 The current mouse position scroll wheel offset (Read Only).
 
static Vector2 Position [get]
 The current mouse position in pixel coordinates. (Read Only).
 
static Vector2 PositionDelta [get]
 The change in mouse position since last frame in pixel coordinates. (Unity 2022.2 and later only) (Read Only).
 
static Vector2 ScrollDelta [get]
 The current mouse position scroll wheel offset (Read Only).
 
static bool LeftButton [get]
 Returns whether the left mouse button is held down.
 
static bool LeftButtonDown [get]
 Returns whether the left mouse button was pressed this frame.
 
static bool LeftButtonUp [get]
 Returns whether the left mouse button was released this frame.
 
static bool RightButton [get]
 Returns whether the right mouse button is held down.
 
static bool RightButtonDown [get]
 Returns whether the right mouse button was pressed this frame.
 
static bool RightButtonUp [get]
 Returns whether the right mouse button was released this frame.
 
static bool MiddleButton [get]
 Returns whether the middle mouse button is held down.
 
static bool MiddleButtonDown [get]
 Returns whether the middle mouse button was pressed this frame.
 
static bool MiddleButtonUp [get]
 Returns whether the middle mouse button was released this frame.
 

Static Public Member Functions

static void SetHandlerToDefault ()
 Sets the mouse handler to the default (Unity's legacy input system)
 
static void SetHandler< MOUSEHANDLER > ()
 Allows you to override the input system used for the mouse with a different IQuestMouseHandler.
 
static bool GetMouseButton (int button)
 Returns whether the given mouse button is held down.
 
static bool GetMouseButtonDown (int button)
 Returns whether the given mouse button is pressed this frame.
 
static bool GetMouseButtonUp (int button)
 Returns whether the given mouse button is released this frame.
 
static bool GetButton (int button)
 Returns whether the given mouse button is held down.
 
static bool GetButtonDown (int button)
 Returns whether the given mouse button is pressed this frame.
 
static bool GetButtonUp (int button)
 Returns whether the given mouse button is released this frame.
 

Property Documentation

◆ mousePosition

Vector2 mousePosition
staticget

The current mouse position in pixel coordinates. (Read Only).

◆ mousePositionDelta

Vector2 mousePositionDelta
staticget

The change in mouse position since last frame in pixel coordinates. (Unity 2022.2 and later only) (Read Only).

◆ mouseScrollDelta

Vector2 mouseScrollDelta
staticget

The current mouse position scroll wheel offset (Read Only).

◆ Position

Vector2 Position
staticget

The current mouse position in pixel coordinates. (Read Only).

◆ PositionDelta

Vector2 PositionDelta
staticget

The change in mouse position since last frame in pixel coordinates. (Unity 2022.2 and later only) (Read Only).

◆ ScrollDelta

Vector2 ScrollDelta
staticget

The current mouse position scroll wheel offset (Read Only).

◆ LeftButton

bool LeftButton
staticget

Returns whether the left mouse button is held down.

◆ LeftButtonDown

bool LeftButtonDown
staticget

Returns whether the left mouse button was pressed this frame.

◆ LeftButtonUp

bool LeftButtonUp
staticget

Returns whether the left mouse button was released this frame.

◆ RightButton

bool RightButton
staticget

Returns whether the right mouse button is held down.

◆ RightButtonDown

bool RightButtonDown
staticget

Returns whether the right mouse button was pressed this frame.

◆ RightButtonUp

bool RightButtonUp
staticget

Returns whether the right mouse button was released this frame.

◆ MiddleButton

bool MiddleButton
staticget

Returns whether the middle mouse button is held down.

◆ MiddleButtonDown

bool MiddleButtonDown
staticget

Returns whether the middle mouse button was pressed this frame.

◆ MiddleButtonUp

bool MiddleButtonUp
staticget

Returns whether the middle mouse button was released this frame.

Member Function Documentation

◆ SetHandlerToDefault()

static void SetHandlerToDefault ( )
inlinestatic

Sets the mouse handler to the default (Unity's legacy input system)

◆ SetHandler< MOUSEHANDLER >()

static void SetHandler< MOUSEHANDLER > ( )
inlinestatic

Allows you to override the input system used for the mouse with a different IQuestMouseHandler.

Type Constraints
MOUSEHANDLER :IQuestMouseHandler 
MOUSEHANDLER :new() 

◆ GetMouseButton()

static bool GetMouseButton ( int button)
static

Returns whether the given mouse button is held down.

◆ GetMouseButtonDown()

static bool GetMouseButtonDown ( int button)
static

Returns whether the given mouse button is pressed this frame.

◆ GetMouseButtonUp()

static bool GetMouseButtonUp ( int button)
static

Returns whether the given mouse button is released this frame.

◆ GetButton()

static bool GetButton ( int button)
static

Returns whether the given mouse button is held down.

◆ GetButtonDown()

static bool GetButtonDown ( int button)
static

Returns whether the given mouse button is pressed this frame.

◆ GetButtonUp()

static bool GetButtonUp ( int button)
static

Returns whether the given mouse button is released this frame.