lmiol wrote: ↑May 8th, 2023, 10:49 pm
Right now hotkey A only works if I hover over the button, which creates a number of ease-of-use difficulties of its own.
It seems to me that some additional and somehow invisible layer is needed here, which would fill the entire desktop, and if the mouse cursor is outside the Steam button, but on this layer - then HotkeyA (Return) will work according to the plan - it will launch Steam = )
For the record and from what I can tell from the codes provided, the padding that is added to the
[Button] meter's image:
Code: Select all
Padding=((#WORKAREAWIDTH#-233)/2),((#WORKAREAHEIGHT#-233)/2),((#WORKAREAWIDTH#-233)/2),((#WORKAREAHEIGHT#-233)/2)
should, in fact, expand the skin area to the entire desktop, assuming that dynamic variables are enabled, the solid color with which the padding is drawn is not entirely transparent, AND the section where you change the
Action variable supports dynamic variables (the
[Rainmeter] section is NOT, with a few exceptions, so these changes can be moved to the meter itself). Based on your uploaded skin earlier (which may or may not be how your skin looks now), this code should do what you want:
Code: Select all
[Variables]
ButtonWidth=233
ButtonHeight=233
PATH=#@#App\
KeyA=0x0D
KeyCTRLWINE=0x11 0x5B 0x45
KeyCTRLWINW=0x11 0x5B 0x57
Action=0
[Rainmeter]
Update=-1
OnUpdateAction=[!Draggable 0][!ZPos -2][!SetWindowPosition "50%" "50%" "50%" "50%"]
[Metadata]
Author=lmiol
Name=Steam Button instead Explorer
Description=Steam Button Instead Explorer
Version=0.0.1
License=Creative Commons BY-NC-SA 3.0
---Measures---
[MeasureKill]
Measure=Plugin
Plugin=RunCommand
Parameter=taskkill /F /IM explorer.exe
State=Hide
OutputType=ANSI
[HotkeyA]
Measure=Plugin
Plugin=HotKey
HotKey=#KeyA#
;KeyUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui -skipinitialbootstrap -noverifyfiles -nobootstrapupdate -norepairfiles -overridepackageurl"] ["C:\Windows\SysWOW64\rundll32.exe" user32.dll,SetCursorPos 0 0"][!SetOption Button ImageName "#@#Images\button.png"][!UpdateMeter Button][PLAY "#PATH#activation.wav"][!Redraw]
;KeyUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui"] ["C:\Windows\SysWOW64\rundll32.exe" user32.dll,SetCursorPos 0 0"][!SetOption Button ImageName "#@#Images\button.png"][!UpdateMeter Button][PLAY "#PATH#activation.wav"][!Redraw]
;KeyDownAction=[!SetOption Button ImageName "#@#Images\pressed.png"][!UpdateMeter Button][!Redraw]
[HotkeyCTRLWINE]
Measure=Plugin
Plugin=HotKey
HotKey=#KeyCTRLWINE#
;KeyUpAction=["C:\Windows\Explorer.exe"][PLAY "#PATH#activation.wav"][!Redraw]
[HotkeyCTRLWINW]
Measure=Plugin
Plugin=HotKey
HotKey=#KeyCTRLWINW#
;KeyUpAction=[!CommandMeasure MeasureKill "Run"][PLAY "#PATH#activation.wav"]
[MeasureHotKey]
Measure=Calc
Formula=#Action#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!Log "Key Input Stopped"][!CommandMeasure "HotkeyA" "Stop"]
IfFalseAction=[!Log "Key Input Started"][!CommandMeasure "HotkeyA" "Start"]
DynamicVariables=1
---Meters---
[Button]
Meter=Image
ImageName=#@#Images\button.png
W=#ButtonWidth#
H=#ButtonHeight#
Padding=((#WORKAREAWIDTH#-#ButtonWidth#)/2),((#WORKAREAHEIGHT#-#ButtonHeight#)/2),((#WORKAREAWIDTH#-#ButtonWidth#)/2),((#WORKAREAHEIGHT#-#ButtonHeight#)/2)
SolidColor=0,0,0,1
MouseOverAction=[!SetVariable Action "1"][!UpdateMeasure "MeasureHotKey"][!SetOption #CURRENTSECTION# ImageName "#@#Images\hover.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetVariable Action "0"][!UpdateMeasure "MeasureHotKey"][!SetOption #CURRENTSECTION# ImageName "#@#Images\button.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
;LeftMouseUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui -skipinitialbootstrap -noverifyfiles -nobootstrapupdate -norepairfiles -overridepackageurl"][PLAY "#PATH#activation.wav"]
;LeftMouseUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui"][PLAY "#PATH#activation.wav"]
;LeftMouseDownAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\pressed.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
;RightMouseUpAction=[]
;RightMouseDownAction=[]
DynamicVariables=1
I commented out all the other key or mouse actions cause I don't want them triggered on my system and they're more or less irrelevant for the subject being discussed here - feel free to uncomment the needed ones or adjust them as desired afterwards. I also added two
!Log bangs that will output to
Rainmeter's log whether the key input is started or stopped, for conveniency - feel free to remove them once you watch the log and see that things happen like you want to. Setting the
Action variable is moved to the
[Button] meter, and also for conveniency, I added two variables from which you can easily control the width and height of the
[Button] image so that you're not tied up to the 233 values anymore - you can adjust them from the
[Variables] section.
P.S. As it is now, the button image is highlighted whenever the mouse is over the entire screen area belonging to the skin, with the exception of other foreground windows that might cover up the skin at some points, like you described. If you want the button image to be highlighted only when you're with the mouse over the said image (and not the entire desktop), you can easily make a blank rectangular Shape or Image meter as big as the desktop, acting as a background, remove the now obsolete padding from the button image, and distribute various bangs accordingly between the two meters:
Code: Select all
---Meters---
[Background]
Meter=Image
W=#WORKAREAWIDTH#
H=#WORKAREAHEIGHT#
SolidColor=0,0,0,1
MouseOverAction=[!SetVariable Action "1"][!UpdateMeasure "MeasureHotKey"]
MouseLeaveAction=[!SetVariable Action "0"][!UpdateMeasure "MeasureHotKey"]
DynamicVariables=1
[Button]
Meter=Image
ImageName=#@#Images\button.png
X=((#WORKAREAWIDTH#-#ButtonWidth#)/2)
Y=((#WORKAREAHEIGHT#-#ButtonHeight#)/2)
W=#ButtonWidth#
H=#ButtonHeight#
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\hover.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\button.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
;LeftMouseUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui -skipinitialbootstrap -noverifyfiles -nobootstrapupdate -norepairfiles -overridepackageurl"][PLAY "#PATH#activation.wav"]
;LeftMouseUpAction=["C:\Program Files (x86)\Steam\Steam.exe" "-gamepadui"][PLAY "#PATH#activation.wav"]
;LeftMouseDownAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\pressed.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
;RightMouseUpAction=[]
;RightMouseDownAction=[]
DynamicVariables=1