io:mouse-down

(io:mouse-down x y)


Description:

Define mouse-down in order to start receiving mouse events


Arguments:

              x -- x coordinate of mouse down

              y -- y coordinate of mouse down


Returns: boolean


Examples:

; override mouse-down function to receive

; mouse down events.  play pitch 80 when

; click is inside the bounds of the *square*

; otherwise play pitch 50.

(define (io:mouse-down x y)

   (if (gfx:point-in-path? *square* x y)

       (play-note (now) synth 74 80 5000 1)

       (play-note (now) synth 50 80 5000)))



Back to index