Page 1 of 3

Can you set a delay before MouseOverAction?

Posted: April 27th, 2015, 2:39 am
by anagrammar
Not that familiar with Rainmeter. I made a little widget that opens my clipboard manager when hovered which works fine. What I haven't been able to figure out is how to set a delay before MouseOverAction kicks in. Just like 2-3 seconds so it doesn't execute when accidentally moused over. This is the code I pieced together from Google:

[Rainmeter]
Update=1000

[Arslauncher]
Meter=Image
ImageName=ac5.png
MouseOverAction=C:\Users\D\acv420\ArsClip.exe -popup

Like I said, it works, but it's probably not technically correct. Any help would be greatly appreciated.

Re: Can you set a delay before MouseOverAction?

Posted: April 27th, 2015, 5:19 am
by balala
To set a delay, add this measure to your code:

Code: Select all

[Timer]
Measure=Calc
Formula=( Timer + 1 )
Disabled=1
IfCondition=(Timer=5)
IfTrueAction=[!DisableMeasure "Timer"][C:\Users\D\acv420\ArsClip.exe -popup]
and these mouse actions to the [Arslauncher] meter:

Code: Select all

MouseOverAction=[!EnableMeasure "Timer"]
MouseLeaveAction=[!DisableMeasure "Timer"]
Note that in the Timer=5 condition (IfCondition in [Timer] measure), 5 is the delay, use the desired value.

Re: Can you set a delay before MouseOverAction?

Posted: April 27th, 2015, 10:43 am
by anagrammar
Worked like a charm. Thank you very much.

Re: Can you set a delay before MouseOverAction?

Posted: April 27th, 2015, 1:59 pm
by balala
I'm glad.

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 5:21 pm
by MrZexx
Can You Please bend the code? So that When Ever I Hover Over the [MeterShape1] for atleast for 3 seconds the [Tip] text should be displayed.

Code: Select all

[Rainmeter]
Update=10
AccurateText=1

[Metadata]
Name= MonoChromatic Forest
Author= Mr. Zexx
Information= A Firewatch out tower in the middle of a Forest.
Version= 1.0

[ReFresh]
Meter=Plugin
Plugin=Hotkey
Hotkey= CRTL R
KeyDownAction=[!Refresh]

[MeasureSettings]
Measure=Plugin
Plugin=HotKey
HotKey=SHIFT ALT S
KeyDownAction=["shell:Appsfolder\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel"]

[Timer]
Measure=Calc
Formula=( Timer + 1 )
Disabled=1
IfCondition=(Timer=5)
IfTrueAction=[!DisableMeasure "Timer"][C:\Users\D\acv420\ArsClip.exe -popup]

[MeterShape1]
Meter=Shape
Shape=Rectangle 36,36,36,36 | FillColor 255,255,255,1 | StrokeWidth 0
MouseOverAction=[!EnableMeasure "Timer"]
MouseLeaveAction=[!DisableMeasure "Timer"]
DynamicVaribles=1
X=-29
Y=-29

[Tip]
Meter=String
FontFace=Galyon Bold
FontColor=255,255,255,255
FontFace=Galyon Bold 
FontSize=12
StringAlign=Left
Text="Settings"
X=0
Y=29
Hidden=1
DynamicVariables=1
AntiAlias=1

[MeterSettings]
Meter=Image
Meter2=String
ImageName=#@#/Icons/settings.png
W=50
LeftMouseUpAction=["shell:Appsfolder\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel"]
DynamicVariables=1
Antialias=1
You can change the code to use ToolTipText but with the delay.

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 6:16 pm
by Yincognito
MrZexx wrote: July 28th, 2023, 5:21 pmSo that When Ever I Hover Over the [MeterShape1] for atleast for 3 seconds the [Tip] text should be displayed.
I'm pretty sure some of the things in your existing code are a bit redundant to begin with (e.g. typos, inconsistent positioning, code for a different user with different files, etc.) and you'll probably want to correct them in the future, but to do what you want:
- change the skin Update from 10 to 1000 milliseconds (this is why it didn't wait 3 x 1000 milliseconds as desired, but 3 x 10 milliseconds)
- change to (Timer=3) in the IfCondition option (obviously, since you want at least 3 and not 5 seconds before the Tip is displayed)
- add [!ShowMeter Tip][!Redraw] to the IfTrueAction (to show the Tip once the Timer reaches the 3 seconds)
- add [!HideMeter Tip][!Redraw] to the MouseLeaveAction (to hide the Tip once mouse leaves the MeterShape1 area)
That would be it. Oh, and read these few lines here and here to understand why you had to do the above. If you want to know the next time you encounter something similar, of course.

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 7:04 pm
by MrZexx
Thank you a lot.
And can you please mention the typos, and positionings as you mentioned.

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 7:07 pm
by Yincognito
MrZexx wrote: July 28th, 2023, 7:04 pm Thank you a lot
You're welcome - glad to help. ;-)

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 7:17 pm
by MrZexx
Yincognito wrote: July 28th, 2023, 7:07 pm You're welcome - glad to help. ;-)
Can you please mention the typos and the inconsistent positions. It will be really helpful.

Re: Can you set a delay before MouseOverAction?

Posted: July 28th, 2023, 7:44 pm
by Yincognito
MrZexx wrote: July 28th, 2023, 7:17 pm Can you please mention the typos and the inconsistent positions. It will be really helpful.
Sure thing.
Typos:
- DynamicVaribles=1, should be DynamicVariables=1
Files:
- C:\Users\D\acv420\ArsClip.exe -popup, not sure you have this, unless you're the same user as the OP from 2015
Positions:
- X=-29, Y=-29, since negative positions are invalid in Rainmeter, you might want to get rid of them to place the shape at 0,0 and just make Rectangle 7,7,36,36 | ...instead
- the Tip meter needs to be placed a bit lower, so its Y should be at least 36+7 aka 43 (unless, of course, the font has a huge blank space at the top to justify the Y=29 positioning)
- you'd probably want the shape and the image to have the same width and height in case the image doesn't have significant transparent margins, so the above could probably warrant corresponding adjustment

That's about it. Obviously, I don't have your image, so I can't tell for sure how it would look, but by looking at the code, these are the obvious inconsistencies.