# Methods Details

## mouseClickAt

```java
public void mouseClickAt(int x, int y)
```

*Perform a left click at the specified coordinates with the mouse.*

### Parameters:

*Coordinates (x, y) where to click :*\
&#x20;**x** - X position\
&#x20;**y** - Y position<br>

[*Find out how to get the coordinates of a specific point on a screen*](https://github.com/obrassard/exbot/tree/f2c885bdf237d73b313482e1d1d06695309d6b65/get-screen-coordinate.md)

## mouseRightClickAt

```java
public void mouseRightClickAt(int x, int y)
```

*Perform a right click at the specified coordinates with the mouse.*

### Parameters:

*Coordinates (x, y) where to click :*\
&#x20;**x** - X position\
&#x20;**y** - Y position<br>

[*Find out how to get the coordinates of a specific point on a screen*](/get-screen-coordinate.md)

## mouseDoubleClick

```java
public void mouseDoubleClick(int x, int y)
```

*Perform a double click at the specified coordinates with the mouse.*

### Parameters:

*Coordinates (x, y):*\
&#x20;**x** - X position\
&#x20;**y** - Y position<br>

[*Find out how to get the coordinates of a specific point on a screen*](/get-screen-coordinate.md)

## mouseDragAndDrop

```java
public void mouseDragAndDrop(int srcX, int srcY, int destX, int destY)
```

*Perform a drag and drop movement from a source coordinate to a destination coordinate with the mouse.*

### Parameters:

**srcX** - X source position\
&#x20;**srcY** - Y source position\
&#x20;**destX** - X destination position\
&#x20;**destY** - Y destination position

[*Find out how to get the coordinates of a specific point on a screen*](/get-screen-coordinate.md)

**Details** : The robot will press the mouse right-button at source coordinates, move the cursor to destination index and release the button\*

## pressEnter

```java
public void pressEnter()
```

*Perform a keyPress/keyRelease on the ENTER key.*

## typeText

```java
public void typeText(String text)
```

*Write text as direct keyboard input.*

### Parameters:

**text** - Text to write *(Work with A-Z letters, space, numbers and dot)*

## writeText <a href="#writetext" id="writetext"></a>

```java
public void writeText(String text)
```

*Write text with the bot by pasting a given string from the clipboard.*<br>

### Parameters:

**text** - Text to write (to paste)

## closeCurrentWindows <a href="#closecurrentwindows" id="closecurrentwindows"></a>

```java
public void closeCurrentWindows()
```

*Close the current windows*\
&#x20;*(Equivalent of `closeCurrentWindows(false)`)*

```java
public void closeCurrentWindows(boolean quit)
```

*Close the current windows or quit an app*<br>

### Parameters:

**quit** - `true` completely quit the current app (on macOS only)

## shortcut <a href="#shortcut" id="shortcut"></a>

```java
public void shortcut(int keycode)
```

*Perform a keyboard shortcut with the cmd or ctrl key (depending of the os) and another specified key*

### Parameters:

**keycode** - Second key to press<br>

*We recommend you to* `import java.awt.event.KeyEvent`, *to enumerate the possible keycodes (e.g. KeyEvent.VK\_A)*

## macShowSpotlight   ![](https://img.shields.io/badge/Exclusive_to-macOS-blue.svg) <a href="#macshowspotlight" id="macshowspotlight"></a>

```java
public void macShowSpotlight()
```

*Do a "cmd + space" to show the Spotlight search box on macOS.*

## windowsShowStart   ![](https://img.shields.io/badge/Exclusive_to-Windows-blue.svg) <a href="#windowsshowstart" id="windowsshowstart"></a>

```java
public void windowsShowStart(String text)
```

*Perform a keyPress/keyRelease on the Windows key to show the start menu.*

## messageSender <a href="#messagesender" id="messagesender"></a>

```java
public void messageSender(int x, int y, String text)
```

*Write text in a text box and "send" it one time (by pressing enter).*<br>

### Parameters:

**x** - X Position of the text box\
&#x20;**y** - Y Position of the text box\
&#x20;**text** - Text to send

```java
public void messageSender(int x, int y, String text, int frequency)
```

*Write text in a text box and "send" it several times (by pressing enter).*<br>

### Parameters:

**x** - X Position of the text box\
&#x20;**y** - Y Position of the text box\
&#x20;**text** - Text to send\
&#x20;**frequency** - Number of repetitions

```java
public void messageSender(int x, int y, String text, int frequency, int interval)
```

*Write string in a text box and "send" it several times (by pressing enter), at a given interval.*<br>

### Parameters:

**x** - X Position of the text box\
&#x20;**y** - Y Position of the text box\
&#x20;**text** - Text to send\
&#x20;**frequency** - Number of repetitions\
&#x20;**interval** - Delay between each sending (in ms)<br>

[*Find out how to get the coordinates of a specific point on a screen*](/get-screen-coordinate.md)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://exbot.obrassard.ca/methods-detail.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
