Next: , Previous: , Up: Input   [Contents][Index]


4.4.2 Mouse

(use-modules (sly input mouse))

Mouse hooks, signals, and procedures.

Scheme Variable: mouse-move-hook

This hook is run whenever the mouse is moved. Procedures added to this hook should accept two arguments: Numbers x and y.

Scheme Variable: mouse-press-hook

This hook is run whenever a mouse button is pressed. Procedures added to this hook should accept three arguments: Symbol button and numbers x and y.

Scheme Variable: mouse-click-hook

This hook is run whenever a mouse button is clicked. Procedures added to this hook should accept three arguments: Symbol button and numbers x and y.

Scheme Signal: mouse-x

The mouse X coordinate.

Scheme Signal: mouse-y

The mouse Y coordinate.

Scheme Signal: mouse-position

The mouse position as a 2D vector.

Scheme Signal: mouse-last-down

The last mouse button pressed.

Scheme Signal: mouse-last-up

The last mouse button clicked.

Scheme Procedure: mouse-down? button

Create a signal for the state of button. Value is #t when mouse button is pressed or #f otherwise.