Description
The IsShiftPressed
property is a static boolean property of the Gizmo
class in the Sandbox namespace. It indicates whether the Shift key is currently being pressed. This property is useful for detecting user input related to keyboard modifiers, particularly when implementing features that require Shift key detection, such as multi-selection or alternative actions in a user interface.
Usage
To use the IsShiftPressed
property, simply access it directly from the Gizmo
class. Since it is a static property, you do not need to instantiate the Gizmo
class to check the state of the Shift key.
Example
// Example of using the IsShiftPressed property
if (Gizmo.IsShiftPressed)
{
// Perform an action when the Shift key is pressed
// For example, enable multi-selection mode
EnableMultiSelectionMode();
}
else
{
// Perform a different action when the Shift key is not pressed
DisableMultiSelectionMode();
}