Description
The WasRightMousePressed
property is a static boolean property of the Gizmo
class in the Sandbox namespace. It indicates whether the right mouse button was pressed during the last frame. This property is useful for detecting user interactions with the right mouse button in a frame-based update loop.
Usage
Use the WasRightMousePressed
property to check if the right mouse button was pressed in the previous frame. This can be particularly useful in scenarios where you need to trigger actions based on mouse input, such as selecting or interacting with objects in a 3D environment.
Since this property is static, it can be accessed directly through the Gizmo
class without needing to instantiate an object.
Example
// Example usage of WasRightMousePressed
if (Gizmo.WasRightMousePressed)
{
// Perform an action when the right mouse button is pressed
// For example, select an object or open a context menu
SelectObject();
}