# Getting cursor position after mouse click

**URL:** https://discuss.codemirror.net/t/getting-cursor-position-after-mouse-click/727
**Category:** Uncategorized
**Created:** [April 23, 2016, 1:38pm UTC](https://discuss.codemirror.net/t/getting-cursor-position-after-mouse-click/727 "2016-04-23T13:38:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lukmajercak](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lukmajercak](https://discuss.codemirror.net/u/lukmajercak)
#### Post date: [April 23, 2016, 1:38pm UTC](https://discuss.codemirror.net/t/getting-cursor-position-after-mouse-click/727/1 "2016-04-23T13:38:38Z")

</div>

Hi guys,

I know this has been discussed before, but none of the suggestions seem to work from me.  
What is the best way of getting the new cursor position after a click? Is there a way of finding out whether the “cursorActivity” event was caused by mouse click or getting the new cursor position from “mousedown” event?

Thanks!!  
Lukas

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)
#### Post date: [May 2, 2016, 9:06am UTC](https://discuss.codemirror.net/t/getting-cursor-position-after-mouse-click/727/2 "2016-05-02T09:06:09Z")

</div>

The `posFromCoords` method might be useful, and maybe also the `origin` field in `"beforeSelectionChange"` events.
