# How to detect if the mouse is over an actor?

**URL:** https://discourse.vtk.org/t/how-to-detect-if-the-mouse-is-over-an-actor/4572
**Category:** Development
**Created:** [November 5, 2020, 2:30am UTC](https://discourse.vtk.org/t/how-to-detect-if-the-mouse-is-over-an-actor/4572 "2020-11-05T02:30:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![learn\_forever](https://discourse.vtk.org/user_avatar/discourse.vtk.org/learn_forever/32/754_2.png) [@learn\_forever](https://discourse.vtk.org/u/learn_forever)
#### Post date: [November 5, 2020, 2:30am UTC](https://discourse.vtk.org/t/how-to-detect-if-the-mouse-is-over-an-actor/4572/1 "2020-11-05T02:30:40Z")

</div>

I can do this by checking if the actor can be picked during mouse moving. But I don’t think this is an efficient way. So, can any VTK experts give me some suggestions? Thanks a lot.

---

<div class="post-metadata">

### Author: ![Shashwath\_T.R1](https://discourse.vtk.org/user_avatar/discourse.vtk.org/shashwath_t.r1/32/2573_2.png) [@Shashwath\_T.R1](https://discourse.vtk.org/u/Shashwath_T.R1)
#### Post date: [November 5, 2020, 12:32pm UTC](https://discourse.vtk.org/t/how-to-detect-if-the-mouse-is-over-an-actor/4572/2 "2020-11-05T12:32:01Z")

</div>

I think the prop picker might be the most efficient way. From the [documentation](https://vtk.org/doc/nightly/html/classvtkPropPicker.html),

> This class uses graphics hardware/rendering system to pick rapidly (as compared to using ray casting as does [vtkCellPicker](https://vtk.org/doc/nightly/html/classvtkCellPicker.html) and [vtkPointPicker](https://vtk.org/doc/nightly/html/classvtkPointPicker.html)).

I doubt you’ll be able to beat the performance of the hardware prop picker by any other means.
