# Power table not catching right click in onMousePressed?

**URL:** <https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [April 27, 2023, 1:15pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963 "2023-04-27T13:15:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 27, 2023, 1:15pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/1 "2023-04-27T13:15:44Z")

</div>

I have a power table that a user wants to be able to double right click on a cell to trigger opening up a window related to the record.

Right now I can't seem to catch the right click at all, but left clicks come through fine.

All I am trying right now is `print event.button` on the extension functions `onMouseClick` and `onMouseDoubleClick` and all I can get is a `1` for left clicking. Nothing comes through for right clicking.

I tried `onMouseclick` under the mouse functions but nothing comes through at all for that, I assume because I am using `configureCell/configureEditor/isCellEditable/onCellEdited` extension functions something is overriding it but I can't get that to print at all.

This does work in another part of the project but its with a simple table, not a power table, and using the mouse event handler mouseClicked on the table, not the power table extension functions.

How can I catch right clicks (and double right clicks) on a cell in a power table?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 27, 2023, 1:23pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/2 "2023-04-27T13:23:29Z")

</div>

You will use `mouseReleased` event handler for right clicks, which has a `clickCount` object property.

Edit: I missed the cell part, not sure mouseReleased will work on an individual cell

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 27, 2023, 1:26pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/3 "2023-04-27T13:26:56Z")

</div>

I am having the same issue. I tried both -  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/aeb099de836718237014951cdab219f3c55e429d.png)

the mouse.onMouseRelease is the same issue - nothing comes through at all. Extension function onMouseRelease works for left clicks but not right clicks again.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 27, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/4 "2023-04-27T13:29:43Z")

</div>

I wonder if it ignores right clicks because you can right click on the header to get a built-in popup menu to configure the table?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 27, 2023, 1:30pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/5 "2023-04-27T13:30:31Z")

</div>

I did notice that when trying and accidentally clicked the header, I never even knew that menu was there before lol. But yea I am wondering if that is the cause.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 27, 2023, 1:34pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/6 "2023-04-27T13:34:53Z")

</div>

You could just use a modifier, like `shift + left click` for editing instead of right clicking. The way I usually handle it is having an edit button to toggle a flag that allows/disallows any editing.

```auto
java.awt.event.MouseEvent[MOUSE_RELEASED,(296,232),absolute(-1314,439),button=1,modifiers=Ctrl+Button1,extModifiers=Ctrl,clickCount=1] on historyTable->view

```

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 27, 2023, 1:36pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/7 "2023-04-27T13:36:55Z")

</div>

This isn't for editing, just to open a popup window related to the specified record. I am going to ask if double left clicks are fine. Not sure how tied they are to having the right click work, though maybe they are given that the other part of the application does do it this way. That's not a bad idea though maybe some other modification.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 27, 2023, 1:37pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/8 "2023-04-27T13:37:05Z")

</div>

This thread is interesting  
[Catching click and right-click events on power table headers - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/catching-click-and-right-click-events-on-power-table-headers/14842)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 27, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/10 "2023-04-27T13:39:21Z")

</div>

onMousePressed works

```auto
#def onMousePress(self, rowIndex, colIndex, colName, value, event):
	if event.button == 3:
		print 'pressed'

```

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 27, 2023, 1:42pm UTC](https://forum.inductiveautomation.com/t/power-table-not-catching-right-click-in-onmousepressed/72963/11 "2023-04-27T13:42:06Z")

</div>

Extension function onMousePress is the winner. Thank you! No table initialization is required either.
