Right click generates left click event, then right click event

I am using LibreOffice 7.1.6.2 (x64) in Windows 10 Pro version 10.0.19043. The attached sample .odb has a button that, at least with the above setup, produces the following MOUSEEVENTS:

Left click Left Click
Middle click Middle Click
Right click Left Click, >>THEN<< Right Click

The only two macros are DBOpen, which opens Access2Base, and ButtonPressed, attached to the button Mouse Pressed event. ButtonPressed certainly looks to me like straightline code, couldn’t possibly be looping anyhow. It seems to be getting two events from a right click. I can’t seem to find a topic about it, so it must not be a common problem. I just created a dead minimum database with a tiny empty table, and a form with a button, an invisible table field, and a label field explaining what to do and expect.
Interesting! If it’s an unfixable bug, I suppose I can throw away right click events, and just treat left and right clicks as identical. I would then use middle clicks for special actions. This fix would work on installations that don’t have the bug–right clicks then simply do nothing instead of doing the same as a left click.
Unless anyone has a fix or a better workaround.

RightClickEvents.odb (13.4 KB)

Hello,

This is apparently due to the right mouse button having two possibilities - Right click and Context menu.

The first is noted as a Left click with Popup Trigger as True:

Screenshot at 2021-11-03 18-15-32

The second is a Right click with Popup Trigger as False:

Screenshot at 2021-11-03 18-15-45

Reference → MouseEvent Struct Reference

I’ll download the SDK API doc. Thank you.