Delaying an Action
Posted: September 18th, 2009, 9:28 am
G'day,
I don't know if anyone else has this problem, but I've noticed over the past few iterations of my scripting that when using the mouseover/mouseleave actions, the mouseleave command in particular doesn't seem to want to play nice and refuses to execute the action I want it to.
For example...the following script displays a piece of text when I mouseover the button and hides it again when I mouseleave the button (well, it should, but then it's Friday evening and I have a drink at hand too ).
[MeterText]
Meter=STRING
.
.
.
Text=Some text here
Hidden=1
[MeterButton]
MeasureName=<Whatever>
Meter=ROUNDLINE
.
.
.
MouseOverAction=!execute [!RainmeterShowMeter MeterText][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter MeterText][!RainmeterRedraw]
I find that, while the mouseover action more often than not fires off and displays the text, the mouseleave action does not often hide the text again. It seems to me that the events that trigger these seem to either get lost somewhere or do not register and so do not get fired off, though I can't actually confirm this.
However, what if an event delay was deliberately introduced to put off the action for a specified period of time before it was executed?
What I would envisage are a few additional clauses that could be used where the mouse/button actions are used. The arguments for the clauses would be the time delay in milliseconds with perhaps a minimum delay of 100ms. These clauses could be, oh, I dunno, for the sake of the argument....
LeftMouseDownDelay
RightMouseDownDelay
LeftMouseUpDelay
RightMouseUpDelay
MouseOverDelay
MouseLeaveDelay
So, to introduce a 1 second delay in the execution of the mouseleave action for the above button meter script, it would look like...
[MeterButton]
.
.
.
MouseOverAction=!execute [!RainmeterShowMeter MeterText][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter MeterText][!RainmeterRedraw]
MouseLeaveDelay=1000
I have no idea if this would have uses for other things that use actions to be perfectly honest, but 'tis out of my head at any rate. Of course, if anyone has resolved this perceived issue or has an alternate solution, I'd be most pleased to hear about it.
Namaste
Culture
I don't know if anyone else has this problem, but I've noticed over the past few iterations of my scripting that when using the mouseover/mouseleave actions, the mouseleave command in particular doesn't seem to want to play nice and refuses to execute the action I want it to.
For example...the following script displays a piece of text when I mouseover the button and hides it again when I mouseleave the button (well, it should, but then it's Friday evening and I have a drink at hand too ).
[MeterText]
Meter=STRING
.
.
.
Text=Some text here
Hidden=1
[MeterButton]
MeasureName=<Whatever>
Meter=ROUNDLINE
.
.
.
MouseOverAction=!execute [!RainmeterShowMeter MeterText][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter MeterText][!RainmeterRedraw]
I find that, while the mouseover action more often than not fires off and displays the text, the mouseleave action does not often hide the text again. It seems to me that the events that trigger these seem to either get lost somewhere or do not register and so do not get fired off, though I can't actually confirm this.
However, what if an event delay was deliberately introduced to put off the action for a specified period of time before it was executed?
What I would envisage are a few additional clauses that could be used where the mouse/button actions are used. The arguments for the clauses would be the time delay in milliseconds with perhaps a minimum delay of 100ms. These clauses could be, oh, I dunno, for the sake of the argument....
LeftMouseDownDelay
RightMouseDownDelay
LeftMouseUpDelay
RightMouseUpDelay
MouseOverDelay
MouseLeaveDelay
So, to introduce a 1 second delay in the execution of the mouseleave action for the above button meter script, it would look like...
[MeterButton]
.
.
.
MouseOverAction=!execute [!RainmeterShowMeter MeterText][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter MeterText][!RainmeterRedraw]
MouseLeaveDelay=1000
I have no idea if this would have uses for other things that use actions to be perfectly honest, but 'tis out of my head at any rate. Of course, if anyone has resolved this perceived issue or has an alternate solution, I'd be most pleased to hear about it.
Namaste
Culture