This is a job for EventHandler
:
EventHandler[
Slider2D[Dynamic[{x, y}], {{0, 0}, {5, 8}, {1, 2}}],
{"MouseUp" :> AppendTo[datalist, {x, y}]},
PassEventsDown -> True
]
Follow the data acquisition with a Dynamic
:
Dynamic[datalist]
{{1,1},{3,4},{2,2},{2,4}}
PassEventsDown -> True
is necessary to prevent EventHandler
from eating up the MouseDrag events that are necessary to make the Slider2D
move. To let Slider2D
update x and y the Dynamic
is necessary. This is well documented in the Slider2D documentation.