# mousePosition

A mouse position record carrying x, y.

Last updated: 2026-09-09

Package: input.mouse | Status: source-declared

Tags: cpu, input, input.mouse, mouse, source-example, thing, yeho

Read mouse position, buttons, and relative input for native interactions.

```yh
external thing mousePosition
```

- int x: Stores x as int.
- int y: Stores y as int.
- mousePosition(int x, int y): Mouse position.

## Use mousePosition

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using input.mouse

// Read mouse position, buttons, and relative input for native interactions.
mousePosition sample = mousePosition(1, 1)
Console.Log(Text.From(sample.x))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.input_mouse__mouseposition"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "input.mouse"
version = "0.1.0"
path = "../../../yeho/packages/input/mouse"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/input.mouse--mousePosition-c3da30cf/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/input/mouse/mouse.yh

AI training permission: https://demonhunterlabs.com/ai-use
