How to get coordinates from a R plotly figure

I have been struggling like mad to solve an apparently basic question. Imagine you have a scatter plot, with say … 10 markers. I suppose this plot has been generated using plotly within a Shiny environment.

One can easily get the coordinates of these markers using the event_data(“plotly_click”) code.

Now imagine you do not need the coordinates of these markers, but the coordinates generated by a mouse click but precisely where no marker exists (for example because you would like to set a new marker exactly there, and you would like to re-use the information coming from that mouse click).

I cannot obtain such a behavior using onclick(), or whatever.

To be more accurate, I would like to add a new point where the user clicked and to be able to use the coordinates to process a new computation.

Any solution for doing so would be really appreciated. Thx

I also want to know this method!