Tag Info

New answers tagged


The text is stored (upon releasing the mouse button) in the variable val with this code: EventHandler[ InputField[], {"MouseUp" :> (val = CurrentValue["SelectionData"])}, PassEventsDown -> True ] It should work in other contexts as well besides InputField, as I noted in my comment it is not clear from your question what the context is.


The following copies the selected text to the clipboard DynamicModule[{}, EventHandler[Dynamic@InputField[x], {"MouseUp" :> FrontEndExecute[FrontEndToken[FrontEnd`SelectedNotebook[], "Copy"]]}, PassEventsDown -> True]]


rulf[x_] := Function[{y}, If[EvenQ[x - y], Style[y, Red, Bold], y]] DynamicModule[{rul = Identity}, Column[EventHandler[Dynamic[rul@#], {"MouseMoved" :> (rul = rulf@#)}] & /@ Range@5]

Top 50 recent answers are included