Mouse Click count inside a module

Hi ,

can we able to capture the mouse click count (how many times user clicked the mouse inside a module)

Is it possible to do?

in the onclick event you can get it with
event.detail
it resets after a delay tho (just like double click does)

Any common gateway script can be written to capture the clicks? because In module where ever user clicks, i want capture and want to store it in database

any client onclick event has this, so i guess if you put it on the root it would get all the clicks?
Why are you trying to store user clicks count tho? xd

Why are you trying to store user clicks count tho?

To know how effective user is using the module. whether they simple open and keeping the module or they using effectively like that

image

I have tired to put like this in root container.
but getting error

AttributeError: 'java.awt.event.MouseEvent' object has no attribute 'detail'

Ah its vision… detail if for perspective

for java its this i guess?
event.getClickCount()
getClickCount ()

ya its working but its starts capturing only when we click on root container. when i click any component its not capturing

I dont know enough about vision to help you sorry.
maybe @pturmel knows more?

In java Swing, events stop propagating up the tree of components/containers at the component where they are consumed. You will need listeners everywhere, including in nested components that are implementation details of Vision components.

I wouldn’t even attempt to do this.

4 Likes

While I agree with Phil that this is very likely a bad idea, I think technically you could install a global AWTEventListener and capture all mouse clicks across the entire program. Turning those clicks into useful component references would be its own challenge, however.

https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/AWTEventListener.html

2 Likes

Thanks i will check it

In which place we to use the global listener… In gateway script?

Any example can you able to give please

Probably a client startup script. You would get an instance of the Toolkit, then register your event listener (filtering for mouse events, most likely):
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Toolkit.html#addAWTEventListener(java.awt.event.AWTEventListener,long)

Forwarding events to the gateway and collecting them is an exercise for the reader.

2 Likes