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
InstallEventHandler({OnMouseMove=p_Raton})
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: InstallEventHandler({OnMouseMove=p_Raton})
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?
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?
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: InstallEventHandler({OnMouseMove=p_Raton})
I tryed to used the ISVideoPlaying, but neither the function worked fine, the problem is that function works only under Windows 7.
Re: InstallEventHandler({OnMouseMove=p_Raton})
In any case your original function can't work, it never hides the mouse pointer. If it does on Windows7, it's a bug
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: InstallEventHandler({OnMouseMove=p_Raton})
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.
Re: InstallEventHandler({OnMouseMove=p_Raton})
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 Just fix your own code.
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: InstallEventHandler({OnMouseMove=p_Raton})
Some idea to better the code?
-
- Posts: 475
- Joined: Fri May 15, 2015 5:15 pm
- Location: Waterville, Minnesota USA
Re: InstallEventHandler({OnMouseMove=p_Raton})
@Juan Carlos
See the second post in this thread. jPV suggested changing the EndIf and the second If to an ElseIf command.
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.
- Juan Carlos
- Posts: 887
- Joined: Mon Sep 06, 2010 1:02 pm
Re: InstallEventHandler({OnMouseMove=p_Raton})
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.