Question for mouse click operation response

Hi,

I have some buttons in a template group in window. When clicked the button, it shall pop out a popup window. I found that when I click the mouse for the first time on some buttons, it doesn’t pop out the popup window, seems that the button doesn’t response the moue click operation. After I clicked the mouse on the button for the second time or several times later, the button can response the mouse click operation each time.

After update the script to use Event handler “actionPerformed” to instead the "mouseClicked ".
The popup window will appear each time when I click the buttons.

So what’s the tiny difference between “actionPerformed” and "mouseClicked " event handler?

Is there method that I can debug for mouse doesn’t response?

Thanks in advance if any help can provide

1 Like

It is not a tiny difference. actionPerformed is the “correct” event to implement for buttons. It takes a number of platform-specific and user input variations into account, including standard keyboard triggers.

1 Like

@pturmel

Thanks for your quick feedback, so it seems that actionPerformed will be better for trigger buttons.

@pturmel

BTW, is there any way that can debugging the mouse or keyboard operation?

From the logging of Ignition, I didn’t see any options related to it.

There’s no particular tool for debugging user input. In Java Swing’s event model, user input events are consumed at the innermost component that has any listener for the specific event type, so any “global” listener will never see such events. There are a few interfaces for global hotkeys, but nothing for mouse events.

As for logging in Ignition, use system.util.getLogger() to obtain a named logger for your own debugging (instead of print, which does not/cannot work everywhere).

@pturmel
Thanks for your help. I will try with your suggestions.

We had an identical problem; occasionally mouse clicks would be ignored for a few seconds, using navigation buttons.

So glad dawei.liu posted about this. Client irritation level has definitely dropped.

However …

Don’t merely change existing button behavior from “Mouse Clicked … --> navigation” to “Action Performed … --> navigation”. This initially worked for me, for some arbitrary number of clicks, varying from 2 to 10 or so. Then the button stopped working altogether. I had to replace the navigation button with a brand-new button using “Action Performed …” before the new bug went away.

Our environment is V 7.9.7, Win 7 Pro, by way of reference.