# getCursorPosition (Client)

> Reads where the cursor is on the screen and the world point it points at.

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

## Syntax

```lua
float|false getCursorPosition()
```

## Returns

Five numbers: `x, y` relative to the screen, from 0 to 1, and `x, y, z` of a world point 300 units ahead of the camera, in the cursor's direction. `false` when the cursor is not free on the screen.

## Example

```lua
addEventHandler("onClientRender", root, function()
    local x, y = getCursorPosition()
    if x then
        dxDrawText(("%.2f, %.2f"):format(x, y), 20, 20)
    end
end)
```

## See also

- [setCursorPosition (Client)](https://wiki.mymp.gg/en/setCursorPosition.md): Moves the cursor to a point on the screen.
- [showCursor (Client)](https://wiki.mymp.gg/en/showCursor.md): Shows or hides the mouse cursor for this resource.
- [onClientCursorMove (Client)](https://wiki.mymp.gg/en/onClientCursorMove.md): Fired when the mouse moves.
