# Momentary Button, Control Value and Mouse Clicks

**URL:** <https://forum.inductiveautomation.com/t/momentary-button-control-value-and-mouse-clicks/66861>\
**Category:** Ignition\
**Created:** [November 23, 2022, 4:36pm UTC](https://forum.inductiveautomation.com/t/momentary-button-control-value-and-mouse-clicks/66861 "2022-11-23T16:36:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 23, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/momentary-button-control-value-and-mouse-clicks/66861/2 "2022-11-23T16:45:08Z")

</div>

This post is a duplicate of your other post.

> [@Mouse Events using event.button1 and actionPerformed](https://forum.inductiveautomation.com/t/mouse-events-using-event-button1-and-actionperformed/66849):
>
> I have a confirmation dialog that uses a button. The button's event handler is mousePressed, which isn't terribly reliable when the operator is moving the cursor slightly at the same time as clicking. My solution was to move the code in actionPerformed instead. Since event.BUTTON1 isn't recognized in actionPerformed, how do I make sure that the script is only executed with the left mouse click?

It is against forum policy to post duplicates threads.

---

_[View the full topic](https://forum.inductiveautomation.com/t/momentary-button-control-value-and-mouse-clicks/66861)._
