Description
The EscapePressed
property is a static boolean property within the Sandbox.Input
class. It indicates whether the Escape key has been pressed. This property is useful for detecting when a user wants to exit or pause the game, as the Escape key is commonly used for such actions in games.
Usage
To use the EscapePressed
property, simply access it directly from the Input
class. Since it is a static property, you do not need to instantiate the Input
class.
Example usage:
if (Input.EscapePressed)
{
// Handle the escape key press, such as pausing the game
PauseGame();
}
Example
if (Input.EscapePressed)
{
// Handle the escape key press, such as pausing the game
PauseGame();
}