# How to Trigger an Event on Left-Click When Mouse Hovers Over a CurveNode?

**URL:** <https://discourse.slicer.org/t/how-to-trigger-an-event-on-left-click-when-mouse-hovers-over-a-curvenode/41209>\
**Category:** Development\
**Created:** [January 22, 2025, 6:13am UTC](https://discourse.slicer.org/t/how-to-trigger-an-event-on-left-click-when-mouse-hovers-over-a-curvenode/41209 "2025-01-22T06:13:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![park](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/park/32/5717_2.png) [@park](https://discourse.slicer.org/u/park)\
**Post date:** [January 22, 2025, 6:13am UTC](https://discourse.slicer.org/t/how-to-trigger-an-event-on-left-click-when-mouse-hovers-over-a-curvenode/41209/1 "2025-01-22T06:13:24Z")

</div>

Hi all,

I have a MarkupsCurveNode and noticed that in the Slice view, the mouse cursor changes to a hand icon when hovering over the curve line. I would like to enhance this behavior with two specific features:

**Trigger Event on Left-Click During Mouse Hover**

- When the mouse hovers over the MarkupsCurveNode line and the cursor changes to a hand icon, I want to allow the user to left-click the line.

- Upon clicking, the closest control point to the clicked position should be identified and moved to the mouse position. I have identified the GetClosestCurvePointIndexToPositionWorld function in CurveNode as useful for this purpose.

- **Could you guide me on how to trigger an event when the cursor changes to a hand icon and the user left-clicks on the curve line?**

**Limit Cursor Change Range in Slice View**

- Currently, the cursor changes to a hand icon whenever the mouse hovers over the MarkupsCurveNode line.

- **I would like to restrict this behavior to a specific distance or region in the Slice view. For example, the cursor should only change when the mouse is within a defined range of the line**.

I would appreciate any guidance or code examples on implementing these features.  
Thank you for your time and support.
