Ehud, this is what I can come up with. Nested EventHandlers.
DynamicModule[
{pR = {0, 0}, pB = {0.5, 0.5}, sel = False},
EventHandler[
EventHandler[
Framed@Dynamic@Graphics[
{PointSize@Large, Red, Point[pR], Blue, Point[pB]}, PlotRange -> 2
],
"MouseDown" :> (sel = EuclideanDistance[MousePosition["Graphics"], pR] >EuclideanDistance[MousePosition["Graphics"], pB])
],
"MouseDragged" :> If[sel, pB = MousePosition["Graphics"], pR = MousePosition["Graphics"]]
]
]
Edit:
On more testing I see that the nesting is not needed. A single EventHandler
also works:
DynamicModule[
{pR = {0, 0}, pB = {0.5, 0.5}, sel = False},
EventHandler[
Framed@Dynamic@Graphics[
{PointSize@Large, Red, Point[pR], Blue, Point[pB]}, PlotRange -> 2
],
{
"MouseDown" :> (sel = EuclideanDistance[MousePosition["Graphics"], pR] > EuclideanDistance[MousePosition["Graphics"], pB]),
"MouseDragged" :> If[sel, pB = MousePosition["Graphics"], pR = MousePosition["Graphics"]]
}
]]