
Sample skin:
Code: Select all
[Variables]
Var1=1
Var2=2
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[InitInputs]
Measure=Calc
IfCondition=1
IfTrueAction=[!SetOptionGroup InputTextGroup FontFace "Consolas"][!SetOptionGroup InputTextGroup FontColor "255,255,255,255"][!SetOptionGroup InputTextGroup FontSize 16][!SetOptionGroup InputTextGroup AntiAlias 1]
UpdateDivider=-1
DynamicVariables=1
[Text1Input]
Group=InputTextGroup
Measure=Plugin
Plugin=InputText
X=[Text1:X]
Y=[Text1:Y]
W=[Text1:W]
H=[Text1:H]
DefaultValue=#Var1#
UpdateDivider=-1
Command1=[!SetVariable Var1 "$UserInput$"]
Command2=[!UpdateMeasure *][!UpdateMeter *][!Redraw]
Command3=[!Log "Enabled scroll from Text1Input commands"][!EnableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
OnDismissAction=[!Log "Enabled scroll from Text1Input dismiss"][!EnableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
DynamicVariables=1
[Text2Input]
Group=InputTextGroup
Measure=Plugin
Plugin=InputText
X=[Text2:X]
Y=[Text2:Y]
W=[Text2:W]
H=[Text2:H]
DefaultValue=#Var2#
UpdateDivider=-1
Command1=[!SetVariable Var2 "$UserInput$"]
Command2=[!UpdateMeasure *][!UpdateMeter *][!Redraw]
Command3=[!Log "Enabled scroll from Text2Input commands"][!EnableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
OnDismissAction=[!Log "Enabled scroll from Text2Input dismiss"][!EnableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
DynamicVariables=1
---Meters---
[Text1]
Meter=String
Y=5R
W=100
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
Text="#Var1#"
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable Var1 (#Var1#+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Var1 (#Var1#-1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!Log "Disabled scroll from Text1 click"][!DisableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"][!CommandMeasure Text1Input "ExecuteBatch All"]
DynamicVariables=1
[Text2]
Meter=String
Y=5R
W=100
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
Text="#Var2#"
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable Var2 (#Var2#+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Var2 (#Var2#-1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!Log "Disabled scroll from Text2 click"][!DisableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"][!CommandMeasure Text2Input "ExecuteBatch All"]
DynamicVariables=1
Actual behavior: when DIRECTLY switching from one input text to another (i.e. without dismissing outside of all input texts first and clicking to edit another input text afterwards), the OnDismissAction of the "leaving" input text triggers AFTER the left click on the "entering" input text, which results in enabling scroll instead of disabling it like desired
More specifically, while the dismiss event of an input text "should" occur BEFORE the click event on another input text (which is also logical from a sequential point of view, not to mention the order of things in Rainmeter, aka measures then meters), the order of these is reversed, making achieving the desired goal impossible in the current implementation. I added some !Log bangs to better illustrate what happens: This should however look like (a bit of photoshopping involved): P.S. A long time ago, it was eclectic-tech if I recall correctly, who came up with a solution to this, but while I already applied it in my skins ever since then, it's kind of redundant to keep repeating this for every little skin where such a functionality is desired (if I remember to do so, that is - if not, the bug becomes a bug in such a skin), so it would be nice if there was a way to fix this. For the record, that solution was to use a variable to increment and decrement the number of input texts that are "active" or "editing" and set the mouse actions based on that and not on the said measure and meter options - something like this:
Code: Select all
[Variables]
Var1=1
Var2=2
SetScroll0=[!EnableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
SetScroll1=[!DisableMouseAction * "MouseScrollDownAction|MouseScrollUpAction"]
NoScroll=0
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=47,47,47,255
---Measures---
[InitInputs]
Measure=Calc
IfCondition=1
IfTrueAction=[!SetOptionGroup InputTextGroup FontFace "Consolas"][!SetOptionGroup InputTextGroup FontColor "255,255,255,255"][!SetOptionGroup InputTextGroup FontSize 16][!SetOptionGroup InputTextGroup AntiAlias 1]
UpdateDivider=-1
DynamicVariables=1
[Text1Input]
Group=InputTextGroup
Measure=Plugin
Plugin=InputText
X=[Text1:X]
Y=[Text1:Y]
W=[Text1:W]
H=[Text1:H]
DefaultValue=#Var1#
UpdateDivider=-1
Command1=[!SetVariable Var1 "$UserInput$"]
Command2=[!UpdateMeasure *][!UpdateMeter *][!Redraw]
Command3=[!SetVariable NoScroll ([#NoScroll]-1)][#SetScroll[#NoScroll]]
OnDismissAction=[!SetVariable NoScroll ([#NoScroll]-1)][#SetScroll[#NoScroll]]
DynamicVariables=1
[Text2Input]
Group=InputTextGroup
Measure=Plugin
Plugin=InputText
X=[Text2:X]
Y=[Text2:Y]
W=[Text2:W]
H=[Text2:H]
DefaultValue=#Var2#
UpdateDivider=-1
Command1=[!SetVariable Var2 "$UserInput$"]
Command2=[!UpdateMeasure *][!UpdateMeter *][!Redraw]
Command3=[!SetVariable NoScroll ([#NoScroll]-1)][#SetScroll[#NoScroll]]
OnDismissAction=[!SetVariable NoScroll ([#NoScroll]-1)][#SetScroll[#NoScroll]]
DynamicVariables=1
---Meters---
[Text1]
Meter=String
Y=5R
W=100
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
Text="#Var1#"
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable Var1 (#Var1#+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Var1 (#Var1#-1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!SetVariable NoScroll ([#NoScroll]+1)][#SetScroll[#NoScroll]][!CommandMeasure Text1Input "ExecuteBatch All"]
DynamicVariables=1
[Text2]
Meter=String
Y=5R
W=100
FontFace=Consolas
FontColor=255,255,255,255
FontSize=16
AntiAlias=1
Text="#Var2#"
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable Var2 (#Var2#+1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Var2 (#Var2#-1)][!UpdateMeasure *][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!SetVariable NoScroll ([#NoScroll]+1)][#SetScroll[#NoScroll]][!CommandMeasure Text2Input "ExecuteBatch All"]
DynamicVariables=1