using GLMakie # We need an interactive backend.
scene = Scene()
on(events(scene).mousebutton) do event
if event.button == Mouse.left && event.action == Mouse.press # Or Mouse.release, as you require.
println("mouse click detected in plot area")
end
end
This is laid out in a few examples at https://docs.makie.org/stable/explanations/events/#mouse_interaction and the simplest example would be: