pointerReleased

Built-ins

Canonical ID: events.pointerReleased. Nederlands: aanwijzerLosgelaten.

A pointer can be a mouse, touch, or pen in a supporting host. Primary selects the main pointer action; a mouse normally uses its main button. A handler is the block below when. The host claims a pointer by following that one pointer through its press and release. The pointer guide explains snapshots, capture, signed coordinates, flooring, and clamping with examples.

Runs on a real primary up by the same pointer that was claimed inside the scene. The up may lie outside the scene: coordinates are floored signed 32-bit logical-plane positions, without clamping. Cancellation or lost capture never synthesizes a release. It runs before a click if the up is inside. Registering this handler alone is sufficient; the other pointer handlers are optional. The host must support the required persistent pointer stream.

Signature

when pointerReleased("primary"):

Arguments

Parameter Type Requirement
button Text literal Exactly the direct literal “primary”; not a variable or translated word.

Return value

Event descriptor.

Example

# language: en
when started():
    clearCanvas("white")
when pointerReleased("primary"):
    say pointerX(), pointerY()

Use a graphical host and perform the documented gesture; the program prints the event coordinates. Stop ends the persistent program.

Notes and common mistakes

Use the function name for your source language. Its canonical ID is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented arguments and value types. Pliro reports mismatches when checking can detect them, or when the call runs.

An event descriptor selects the event in a top-level when header, outside other blocks (E3201E3203). A reporter is an ordinary function that returns a value, such as pointerX; broadcast is an ordinary call too. A handler is the block reacting to an event. Key and pointer handlers keep a run ready for future input and need host support (E4019). Pointer reporters need the current pointer event (E4020). The whole run has a shared event-work limit (E4018). Ordinary setup must finish before handlers get turns. See event rules and pointer positions.

started · after · messageReceived · keyPressed · pointerPressed · Programming guides · Host support · Calls and arguments