---
name: "al_set_mouse_xy"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_set_mouse_xy"
---

# al\_set\_mouse\_xy(3)

Allegro 5 API

## NAME

al\_set\_mouse\_xy - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  bool al_set_mouse_xy(ALLEGRO_DISPLAY *display, int x, int y)
  ```

## DESCRIPTION

Try to position the mouse at the given coordinates on the given display. The mouse movement resulting from a successful move will generate an ALLEGRO\_EVENT\_MOUSE\_WARPED(3) event.

Returns true on success, false on failure.

## SEE ALSO

[al\_set\_mouse\_z(3)](/al_set_mouse_z/3.md), [al\_set\_mouse\_w(3)](/al_set_mouse_w/3.md)
