It is currently October 14th, 2024, 10:33 am
HotKey plugin 1.0
-
- Posts: 104
- Joined: June 7th, 2021, 11:46 am
Re: HotKey plugin 1.0
That actually did what I wanted! Thanks, had no idea I'll have to specify L/R
-
- Posts: 8
- Joined: May 1st, 2020, 8:17 pm
Re: HotKey plugin 1.0
I'm trying to figure out how to perform certain hotkey actions if conditions are met, but I'm struggling with the logic of how to get this to work. I feel like I need to put the IfCondition within the HotKey action but I'm not sure how to do it since I have to specify a KeyDownAction instead of an IfTrueAction. I know the code below isn't going to work since I'm mixing IfConditions and KeyDownAction, but I'm trying to get something like this to work. Any help would be appreciated.
Code: Select all
[HideSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#HideKey#
IfCondition=MeasurePlayPause = 2
KeyDownAction=[!RainmeterHide *][!CommandMeasure "MeasureMedia" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"]
IfCondition2=MeasurePlayPause <> 2
KeyDownAction2=[!RainmeterHide *][!CommandMeasure "MeasureMedia" "VolumeMute"]
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: HotKey plugin 1.0
Ahh no it doesn't work like this. But in the meanwhile you can do something likeDevo wrote: ↑October 15th, 2021, 8:26 pm I'm trying to figure out how to perform certain hotkey actions if conditions are met, but I'm struggling with the logic of how to get this to work. I feel like I need to put the IfCondition within the HotKey action but I'm not sure how to do it since I have to specify a KeyDownAction instead of an IfTrueAction. I know the code below isn't going to work since I'm mixing IfConditions and KeyDownAction, but I'm trying to get something like this to work. Any help would be appreciated.Code: Select all
[HideSkins] Measure=Plugin Plugin=HotKey HotKey=#HideKey# IfCondition=MeasurePlayPause = 2 KeyDownAction=[!RainmeterHide *][!CommandMeasure "MeasureMedia" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"] IfCondition2=MeasurePlayPause <> 2 KeyDownAction2=[!RainmeterHide *][!CommandMeasure "MeasureMedia" "VolumeMute"]
Code: Select all
[Variables]
...
HideSkins0=[!Hide][!CommandMeasure MeasureMedia PlayPause][!CommandMeasure MeasureMedia VolumeMute]
HideSkins1=[!Hide][!CommandMeasure MeasureMedia VolumeMute]
[IsPlaying]
Measure=Calc
Formula=MeasurePlayPause <> 2
[HideSkins]
Measure=Plugin
Plugin=HotKey
HotKey=#HideKey#
KeyDownAction=[#HideSkins[&IsPlaying]]
from the Realm of Death
-
- Rainmeter Sage
- Posts: 16653
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
Not sure at all what would you like to achieve. Do you want to perform different actions on keystroke depending if the condition is true or false? This is what I figured out, but please let me know if I am right.Devo wrote: ↑October 15th, 2021, 8:26 pm I'm trying to figure out how to perform certain hotkey actions if conditions are met, but I'm struggling with the logic of how to get this to work. I feel like I need to put the IfCondition within the HotKey action but I'm not sure how to do it since I have to specify a KeyDownAction instead of an IfTrueAction. I know the code below isn't going to work since I'm mixing IfConditions and KeyDownAction, but I'm trying to get something like this to work. Any help would be appreciated.
-
- Posts: 8
- Joined: May 1st, 2020, 8:17 pm
Re: HotKey plugin 1.0
That's correct. @death.crafter's solution works, but I'm wondering if there's a more elegant(?) or simpler solution.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
-
- Rainmeter Sage
- Posts: 16653
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
A set of IfConditions might be added to the [MeasurePlayPause] measure, to set different operations to the KeyDownAction option, depending on the state of the condition. This is more or less the same as death.crafter's solution, however not entirely. If you are interested but don't know how to achieve it, please let me know, to post a sample.
-
- Posts: 8
- Joined: May 1st, 2020, 8:17 pm
Re: HotKey plugin 1.0
I would appreciate an example. I've been modifying skins over the years off an on, but this is the first time I've tried to create something from scratch for my specific use case. Your posts have helped me over the years, so I appreciate this and everything else you've posted.balala wrote: ↑October 19th, 2021, 5:27 pm A set of IfConditions might be added to the [MeasurePlayPause] measure, to set different operations to the KeyDownAction option, depending on the state of the condition. This is more or less the same as death.crafter's solution, however not entirely. If you are interested but don't know how to achieve it, please let me know, to post a sample.
-
- Rainmeter Sage
- Posts: 16653
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
Ok, here is it. Add the IfCondition / IfTrueAction / IfFalseAction options to the [MeasurePlayPause] measure, without modifying it otherwise. The two !SetOption bangs will set the appropriate KeyDownAction option to the [HideSkins] measure:Devo wrote: ↑October 19th, 2021, 5:32 pm I would appreciate an example. I've been modifying skins over the years off an on, but this is the first time I've tried to create something from scratch for my specific use case. Your posts have helped me over the years, so I appreciate this and everything else you've posted.
Code: Select all
[MeasurePlayPause]
...
IfCondition=(MeasurePlayPause=2)
IfTrueAction=[!SetOption HideSkins KeyDownAction """[!Hide *][!CommandMeasure "MeasureMedia" "PlayPause"][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"]
IfFalseAction=[!SetOption HideSkins KeyDownAction """[!Hide *][!CommandMeasure "MeasureMedia" "VolumeMute"]"""][!UpdateMeasure "HideSkins"]
Take care that the !Hide (used by you above) and the !Hide * (used by Devo, in the !RainmeterHide * form), perform different actions. First is hiding the current skin, while the last is hiding ALL activated skins.death.crafter wrote: ↑October 15th, 2021, 9:13 pmCode: Select all
[Variables] ... HideSkins0=[!Hide][!CommandMeasure MeasureMedia PlayPause][!CommandMeasure MeasureMedia VolumeMute] HideSkins1=[!Hide][!CommandMeasure MeasureMedia VolumeMute] [IsPlaying] Measure=Calc Formula=MeasurePlayPause <> 2 [HideSkins] Measure=Plugin Plugin=HotKey HotKey=#HideKey# KeyDownAction=[#HideSkins[&IsPlaying]]
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm