# showCursor (Client)

> Shows or hides the mouse cursor for this resource.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Keyboard
- **URL**: https://wiki.mymp.gg/en/showCursor

## Syntax

```lua
bool showCursor(bool show [, bool toggleControls = true])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `show` | `bool` | `true` to show it, `false` to withdraw this resource's request. |
| `toggleControls` | `bool` | If `true`, the player's controls are off while the cursor shows. *(default: `true`)* |

## Returns

`true` when the request was taken.

Each resource makes its own request. The cursor shows while any resource asks for it, and the controls are off while any of those requests used `toggleControls`. Hiding only withdraws this resource's request, and the request goes away when the resource stops.

## Example

```lua
bindKey("m", "down", function()
    showCursor(not isCursorShowing())
end)
```

## See also

- [isCursorShowing (Client)](https://wiki.mymp.gg/en/isCursorShowing.md): Tells whether the mouse cursor is showing.
- [getCursorPosition (Client)](https://wiki.mymp.gg/en/getCursorPosition.md): Reads where the cursor is on the screen and the world point it points at.
- [setCursorAlpha (Client)](https://wiki.mymp.gg/en/setCursorAlpha.md): Changes the mouse cursor's opacity.
- [onClientClick (Client)](https://wiki.mymp.gg/en/onClientClick.md): Fired when a mouse button is pressed or released while the cursor is showing.
