InstallEventHandler({OnMouseMove=p_Raton})

Find quick help here to get you started with Hollywood
Post Reply
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

InstallEventHandler({OnMouseMove=p_Raton})

Post by Juan Carlos »

I tryed to used this InstallEventHandler({OnMouseMove=p_Raton}) with this function to show/hide the mouse pointer with you play video and move the mouse, to hide or to show it, but the problem under Windows 7 64 bit it works, but under Windows 10 64 bit, MorphOS 3.11 and AmigaOS3.9 it doesn't work, the mouse pointer continues on the screen. Any idea of problem?

Function p_Raton()
;Hide mouse pointer.
If CursorRaton=1 And Video=1
HidePointer()
CursorRaton=0
EndIf
;Show mouse pointer.
If CursorRaton=0
ShowPointer()
CursorRaton=1
EndIf
EndFunction
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by jPV »

This can't work, because:

Function p_Raton()
;Hide mouse pointer.
If CursorRaton=1 And Video=1
HidePointer() ; <--- Mouser pointer gets hidden
CursorRaton=0 ; <--- CursorRaton gets 0
EndIf
;Show mouse pointer.
If CursorRaton=0 ; <--- CursorRaton was set to 0 in the previous IF, so this is also executed
ShowPointer() ; <--- Pointer is shown again so it never actually gets hidden. Or is hidden just an eye blink.
CursorRaton=1
EndIf
EndFunction


Maybe this would do what you wanted? Add the video check for the latter if too.

Function p_Raton()
If CursorRaton=1 And Video=1
HidePointer()
CursorRaton=0
ElseIf CursorRaton=0 And Video=0
ShowPointer()
CursorRaton=1
EndIf
EndFunction

; Have this when you start the program and you have pointer visible:
CursorRaton=1


But maybe you should put HidePointer() and ShowPointer() somewhere where you start/stop the video playback, and not check these all the time when you move the mouse?
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by Juan Carlos »

I tryed to used the ISVideoPlaying, but neither the function worked fine, the problem is that function works only under Windows 7.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by jPV »

In any case your original function can't work, it never hides the mouse pointer. If it does on Windows7, it's a bug :)
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by Juan Carlos »

It isn't the first time that some instructions work in one system and in others not, someones work under Windows and under MorphOS or AmigaOS work of different way.
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by jPV »

Well, it's more problematic if something should work and it doesn't work on some systems, but with your code this clearly shouldn't work, so not much harm done if it in some miraculous way works under Win7 :P Just fix your own code.
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by Juan Carlos »

Some idea to better the code?
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by SamuraiCrow »

@Juan Carlos
See the second post in this thread. jPV suggested changing the EndIf and the second If to an ElseIf command.
I'm on registered MorphOS using FlowStudio.
User avatar
Juan Carlos
Posts: 887
Joined: Mon Sep 06, 2010 1:02 pm

Re: InstallEventHandler({OnMouseMove=p_Raton})

Post by Juan Carlos »

Thank all for your help, yes I put elseif and the code now works perfectly under all Amiga systems, I work in three proyects and sometimes I didn't see this failures.
Post Reply