Capture "global" mouse click?

Find and share HowTos to various installations / configurations!
Search

Post Reply
3 posts • Page 1 of 1
NikolayLevchenko
Posts: 74
Joined: Wed May 10, 2017 3:34 pm

Capture "global" mouse click?

Post by NikolayLevchenko »

Is there any way to capture a mouse click that happens anywhere? I just need to know if a user clicked somewhere inside the WinCC OA window and get the coordinates of where he/she clicked. Is this possible?

I know I can attach onClick|() to a panel but I have >100 panels and this would be a major pain (and possibly unmaintainable). I can't seem to find a way to capture onClick() event on a module. Any other ideas?

User avatar
leoknipp
Posts: 2926
Joined: Tue Aug 24, 2010 7:28 pm

Re: Capture "global" mouse click?

Post by leoknipp »

In the property editor for a panel you have the option "Send Mouseclick". If someone clicks on the panel, not an object, the _Ui_<num>.MouseClick.* datapoint elements are updated.
When saving a panel with and without the option you can see the differences in the panel file. With this information you can possibly write a tool/script which modifies all panel files. In case of the xml panel format doing the changes via script should be an easy task.

What is the use case of capturing the mouse click?

Best Regards
Leopold Knipp
Senior Support Specialist

NikolayLevchenko
Posts: 74
Joined: Wed May 10, 2017 3:34 pm

Re: Capture "global" mouse click?

Post by NikolayLevchenko »

Thanks for the idea, Leopold, I'll see how this fits.
This is for a custom-made navigation menu that looks like drop-down multi-level cascade-style manu. We wanted to have a few features in it (e.g. sumalert indicators on each item on all levels) so we could not use a standard Cascade widget.

Opening these drop-downs is easy (basically just opening panels on-click) but I also want to close them all when a user clicks anywhere outside the open menus (e.g. main part of the UI), hence my question

Post Reply
3 posts • Page 1 of 1