> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/flatredball/api/flatredball/gui/cursor/primaryclick.md).

# PrimaryClick

### Introduction

The PrimaryClick property returns whether the Cursor has been clicked this frame. A click is defined as:

* [PrimaryDown](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) was true last frame and...
* PrimaryDown is false this frame

This occurs if the user pushes and releases the left moue button or touches and lifts on the touch screen. If developing games which may use a touch screen, you should consider [PrimaryClickNoSlide](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) to differentiate between when the user touches and releases in the same spot vs. when the user touches, slides, then releases.

### Example

The cursor can be checked to see if a click occurred in any CustomActivity code. The following code creates a Circle wherever the user clicks:

```csharp
if(GuiManager.Cursor.PrimaryClick)
{
    var circle = new Circle();
    circle.Visible = true;
    circle.X = GuiManager.Cursor.WorldXAt(0);
    circle.Y = GuiManager.Cursor.WorldYAt(0);
}
```

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-5a6b6f67269ff372ee2a148fe2d707bc90b56c1d%2F2016-01-2017-12-14_08-49-02-1.gif?alt=media" alt=""><figcaption><p>Creating circles by clicking the cursor primary button</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/flatredball/api/flatredball/gui/cursor/primaryclick.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
