Page 1 of 1
Layerbutton and OnMouse... events
Posted: Sun Oct 01, 2023 11:05 am
by Flinx
If a mouse action is performed over a layer button and the program is currently busy with some time-consuming activity such as file operations, and the user quickly moves the mouse away after the click, it happens that in the event function the immediately read mouse position is completely wrong.
Would Hollywood's architecture allow to supply the mouse coordinates from the time the event was triggered?
Re: Layerbutton and OnMouse... events
Posted: Tue Oct 03, 2023 12:49 pm
by airsoftsoftwair
How do you read the mouse position in the event callback? Using
MouseX() and
MouseY()?
Re: Layerbutton and OnMouse... events
Posted: Tue Oct 03, 2023 10:45 pm
by Flinx
Yes.
Code: Select all
Function p_EventControlButton(msg)
Local mousepX=MouseX()
Local mousepY=MouseY()
Re: Layerbutton and OnMouse... events
Posted: Tue Oct 10, 2023 9:05 pm
by airsoftsoftwair
Ok, I see, I think I can add support for "x" and "y" fields in the table that is passed to the event callback and set them to the mouse position at the time the event occurred. Then it should be possible to get the correct coordinates at the time of the event.
Re: Layerbutton and OnMouse... events
Posted: Wed Oct 11, 2023 9:39 am
by Flinx
Great, I was hoping something like that would be possible.
Re: Layerbutton and OnMouse... events
Posted: Sun Jul 21, 2024 10:21 pm
by airsoftsoftwair
Code: Select all
- New: The "OnMouseDown" and "OnMouseUp" (left, right, middle, wheel) event callbacks for the display and
for #SIMPLEBUTTON and #LAYERBUTTON will also receive the position of the mouse pointer at the time the
button was clicked/released now; the position will be in the fields "MouseX" and "MouseY" for simple and
layer buttons and in the fields "X"/"Y" for the global display event handlers