I tried using disablemeasure, pausemeasure and togglepausemeasure to no avail
So the solution I came up with was a setoption that changed the hotkey to something obnoxious (like mouseclick+scroll lock) during unfocus.
This ends up generating some quite long bang lines in the Rainmeter section:
Code: Select all
[Rainmeter]
Update=100
BackgroundMode=2
SolidColor=#BackgroundColor#
OnFocusAction=[!SetOption Focus Text "Rainmeter focused"][!UpdateMeter *][!SetVariable FOCUS 1][!SetOption Green Hotkey DOWN][!SetOption Red Hotkey UP][!SetOption Blue Hotkey LEFT][!SetOption Black Hotkey RIGHT][!UpdateMeasureGroup Keys][!Redraw]
OnUnfocusAction=[!SetOption Focus Text "Rainmeter unfocused"][!UpdateMeter *][!SetVariable FOCUS 0][!SetOption Green Hotkey "MBUTTON SCROLLLOCK"][!SetOption Red Hotkey "MBUTTON SCROLLLOCK"][!SetOption Blue Hotkey "MBUTTON SCROLLLOCK"][!SetOption Black Hotkey "MBUTTON SCROLLLOCK"][!UpdateMeasureGroup Keys][!UpdateMeasure Green][!Redraw]
[Variables]
BackgroundColor=50,50,50,255
Key1=UP
Key2=DOWN
Key3=LEFT
Key4=RIGHT
Key5=MBUTTON SCROLLLOCK
FOCUS=1
[Red]
Measure=Plugin
Plugin=HotKey
Group=Keys
DynamicVariables=1
HotKey=UP
KeyUpAction=[!SetOption Background SolidColor "#BackgroundColor#"][!UpdateMeter Background][!Redraw]
KeyDownAction=[!SetOption Background SolidColor "255,0,0,255"][!UpdateMeter Background][!Redraw]
[Green]
Measure=Plugin
Plugin=HotKey
Group=Keys
HotKey=#Key2#
KeyDownAction=[!SetOption Background SolidColor "0,255,0,255"][!UpdateMeter Background][!Redraw]
KeyUpAction=[!SetOption Background SolidColor "#BackgroundColor#"][!UpdateMeter Background][!Redraw]
[Blue]
Measure=Plugin
Plugin=HotKey
HotKey=#Key3#
KeyDownAction=[!SetOption Background SolidColor "0,0,255,255"][!UpdateMeter Background][!Redraw]
KeyUpAction=[!SetOption Background SolidColor "#BackgroundColor#"][!UpdateMeter Background][!Redraw]
[Black]
Measure=Plugin
Plugin=HotKey
HotKey=#Key4#
KeyDownAction=[!SetOption Background SolidColor "0,0,0,255"][!UpdateMeter Background][!Redraw]
KeyUpAction=[!SetOption Background SolidColor "#BackgroundColor#"][!UpdateMeter Background][!Redraw]
[Style]
FontColor=255,255,255,255
X=18R
Y=5
DynamicVariables=1
AntiAlias=1
[Style1]
X=5
Y=2R
FontSize=8
[Focus]
Meter=String
MeterStyle=Style
Text=Rainmeter focused
[Background]
Meter=Image
SolidColor=#BackgroundColor#
X=0
Y=5R
W=200
H=90
[Key1Label]
Meter=String
MeterStyle=Style | Style1
Text=Red: #Key1#
Y=5r
[Key2Label]
Meter=String
MeterStyle=Style | Style1
Text=Green: #Key2#
[Key3Label]
Meter=String
MeterStyle=Style | Style1
Text=Blue: #Key3#
[Key4Label]
Meter=String
MeterStyle=Style | Style1
Text=Black: #Key4#
[Label5]
Meter=String
MeterStyle=Style | Style1
Text=FOCUS: #FOCUS#