Page 1 of 1

ShowPointer() without mouse activity

Posted: Tue Aug 23, 2022 1:26 pm
by Flinx
The ShowPointer() function only works when a status change comes from the mouse buttons or there is a movement. This does not bother much, but maybe it can be improved. Here an event should display the pointer when the mouse button is pressed, but this only works if there is further mouse activity after the event.
My test script:

Code: Select all

EnableLayers()
TextOut(10,10,"Start",{Name="msg"})
For i=1 To 100
	Wait(2500,#MILLISECONDS)
	SetLayerStyle("msg", {Text="HidePointer"})
	HidePointer()
	Wait(2500,#MILLISECONDS)
	SetLayerStyle("msg", {Text="ShowPointer"})
	ShowPointer()
Next

Re: ShowPointer() without mouse activity

Posted: Wed Aug 24, 2022 9:01 am
by Bugala
I can confrim this. Same happens with Windows 10 Hollywood 9.1.

Hidepointer works fine, but ShowPointer doesnt happen, unless I move my mouse or something.

Re: ShowPointer() without mouse activity

Posted: Mon Aug 29, 2022 10:43 pm
by airsoftsoftwair
Yes, I can confirm it too. Will be fixed.

Re: ShowPointer() without mouse activity

Posted: Tue Aug 30, 2022 3:39 pm
by Flinx
By the way, I remember that moving a layer under the mouse also did not trigger an OnMouseOver event if there was no mouse movement. Maybe this is the same effect?

Re: ShowPointer() without mouse activity

Posted: Tue Aug 30, 2022 9:05 pm
by airsoftsoftwair
Have you got an MCVE for that?

Re: ShowPointer() without mouse activity

Posted: Wed Aug 31, 2022 10:24 am
by Flinx
Sure. It was a Layer button. Move the pointer over the box, and then place it in the path of the box.

Code: Select all

EnableLayers()

Function p_blue()
	SetDisplayAttributes({Color=$003377})
EndFunction

Function p_black()
	SetDisplayAttributes({Color=#BLACK})
EndFunction

Function p_Main()
	xp=xp+1
	If xp>GetAttribute(#DISPLAY, 1, #ATTRWIDTH) Then xp=-50
	SetLayerStyle("box", {X=xp})
EndFunction

SetFillStyle(#FILLCOLOR)
xp=0
Box(xp, 100, 50, 50, #GRAY, {Name="box"})
MakeButton(1, #LAYERBUTTON, "box", {OnMouseOver=p_blue, OnMouseOut=p_black})
SetInterval(1, p_Main, 30)

Repeat
	WaitEvent
Forever

Re: ShowPointer() without mouse activity

Posted: Sat Sep 03, 2022 11:56 pm
by airsoftsoftwair
Thanks, now I understand the issue but I'm not sure if I'm going to fix this because it can probably trigger lots of unwanted behaviour for scripts that expect the old behaviour. The first issue is clearly a bug, though.

Re: ShowPointer() without mouse activity

Posted: Sun Sep 04, 2022 9:30 am
by Flinx
Maybe it makes sense to collect such things, and introduce a global switch for a compatibility mode at some point?

Re: ShowPointer() without mouse activity

Posted: Fri Sep 09, 2022 11:23 pm
by airsoftsoftwair
Flinx wrote: Sun Sep 04, 2022 9:30 am Maybe it makes sense to collect such things, and introduce a global switch for a compatibility mode at some point?
Yes, introducing a compatibility mode would be the only way to fix this.

Re: ShowPointer() without mouse activity

Posted: Sat Jan 07, 2023 6:35 pm
by airsoftsoftwair

Code: Select all

- Fix [Windows]: ShowPointer() wasn't effective until a mouse event came in