mouse-button

mouse-pressed?

mouse-x

mouse-y

pmouse-x

pmouse-y

mouse-button

Arguments
[]
Docstring

The value of the system variable mouseButton is either :left, :right, or :center depending on which button is pressed. nil if no button pressed

Works only inside sketch functions?
Yes
Original Processing method
mouseButton
Original p5js method
mouseButton
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example

mouse-pressed?

Arguments
[]
Docstring

true if a mouse button is pressed, false otherwise.

Works only inside sketch functions?
Yes
Original Processing method
mousePressed
Original p5js method
mouseIsPressed
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example

mouse-x

Arguments
[]
Docstring

Current horizontal coordinate of the mouse.

Works only inside sketch functions?
Yes
Original Processing method
mouseX
Original p5js method
mouseX
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example

mouse-y

Arguments
[]
Docstring

Current vertical coordinate of the mouse.

Works only inside sketch functions?
Yes
Original Processing method
mouseY
Original p5js method
mouseY
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example

pmouse-x

Arguments
[]
Docstring

Horizontal coordinate of the mouse in the previous frame

Works only inside sketch functions?
Yes
Original Processing method
pmouseX
Original p5js method
pmouseX
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example

pmouse-y

Arguments
[]
Docstring

Vertical coordinate of the mouse in the previous frame

Works only inside sketch functions?
Yes
Original Processing method
pmouseY
Original p5js method
pmouseY
Example
(q/background 255)
(q/fill 0)
; iterate through all mouse-related functions
; and print their values
(doseq [[ind capt fn] [[0 "mouse-button" q/mouse-button]
                       [1 "mouse-pressed?" q/mouse-pressed?]
                       [2 "mouse-x" q/mouse-x] [3 "mouse-y" q/mouse-y]
                       [4 "pmouse-x" q/pmouse-x] [5 "pmouse-y" q/pmouse-y]]]
  (q/text (str capt " " (fn)) 10 (+ (* 20 ind) 20)))
try example