In LibreOffice Basic, it is possible to have macros called by adding a Button Control to a Form and then associating a macro with any of several events.
If you want the event to occur when a user clicks the button, you have two choices:
Mouse button pressed
Mouse button released
Here is the problem and requested enhancement: neither of these events in LO mimic the way buttons are actually designed to behave in any operating system. Specifically, the normal way a button triggers an event is when the user clicks on it and then releases the mouse button CRITICALLY: while the mouse cursor is still over the button in question.
In contrast to the desired functionality, the 'button pressed' event occurs when the control is depressed, regardless of whether the mouse button is released. This can be useful, but it is not the most useful kind of button event.
In contrast to the desired functionality, the 'button released' event occurs regardless of whether the mouse cursor moves off of the button before the mouse button is released, indeed, the event is triggered even when *there was no 'button pressed' event for the button control.* For example, you might use a 'button pressed' event in Form1 to open Form2, and then your cursor might inadvertently activate the 'button released' event of a control on Form2 simply by releasing the button after clicking Form1.
There should be a way to trigger an event only when there is both a 'mouse button pressed' and then 'mouse button released' event on the same control, while the mouse cursor is on the control both when the button is depressed and when the mouse button is released. This is the way button controls are supposed to work, and indeed the way they do work everywhere else.
I have labeled this as an enhancement.
Functionality experienced on Windows 7 LO 4.3, 4.4.
I don't agree. The advantage of on press and on release is that you facilitate navigation and activation of the events with the keyboard, which is very useful for people with disabilities and doesn't require the mouse cursor to be anywhere near the button.
The LO development team manifestly does agree with the concept behind this report, because every other button in the LO product works the way suggested in this enhancement, except macro control buttons on Base forms.
In fact, I have never encountered a UI anywhere, other than LO form macros, that still activates the action when the mouse cursor is no longer on the command button when the mouse button is released.
For example, if I press the 'save changes' button on this Bugzilla page, and then decide 'wait, nevermind, actually I agree with Alex,' and move the cursor off the button before releasing the mouse button, the page is not saved. This is true for all command buttons implemented in LO, except LO form macros, which anomalously trigger the 'mouse button released' command even if the cursor no longer is on the command button when the mouse button is released.
I agree that there is a time and place for these event triggers, but the *best* command trigger-- the one that is ubiquitous throughout all of the LO UI and everywhere else-- is missing, and that is the request for enhancement.
OK, I understand better what you are aiming at, sorry, my bad for misinterpreting from the first comment.
Seems fair enough request, but I'm not a dev so will leave it as enhancement.