It is currently December 9th, 2021, 3:38 am

HotKey plugin 1.0

Plugins and Addons popular with the Community
User avatar
death.crafter
Rainmeter Sage
Posts: 1208
Joined: April 24th, 2021, 8:13 pm

Re: HotKey plugin 1.0

Post by death.crafter »

balala wrote: October 20th, 2021, 6:11 pm Actually it's not.
Have you tried? Just asking, because if any KeyDownAction option is set explicitly on the measure, it can be easily modified through a !SetOption bang.

Code: Select all

[Rainmeter]
OnRefreshAction=[!SetOption mString SolidColor "FFFFFF"][!SetOption mString LeftMouseUpAction """[!SetOption String String "A"][!Update]"""][!Update]

[String]
Measure=String

[mString]
Meter=String
MeasureName=String
H=20
W=20
balala wrote: October 20th, 2021, 6:11 pm There is no extra measure in my code either. But finally doesn't matter too much. Which solution is preferred by a user depends by more things. I didn't say your solution is not good, there is nothing wrong with it. But when Devo said that:

I came with the !SetOption solution. As usually there are more solutions to the same question. Your is one of them, mine is another. None better, none worse...
I was referring to my previous solution actually when indicating measures.

But you are right, depends on the user. I usually find it complicated to set actions through actions. Sorry for the misunderstanding :D
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 13533
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

death.crafter wrote: October 20th, 2021, 6:23 pm

Code: Select all

[Rainmeter]
OnRefreshAction=[!SetOption mString SolidColor "FFFFFF"][!SetOption mString LeftMouseUpAction """[!SetOption String String "A"][!Update]"""][!Update]

[String]
Measure=String

[mString]
Meter=String
MeasureName=String
H=20
W=20
Not sure what do you want to demonstrate with this code. It doesn't contain a HotKey plugin measure, so what's the point?
Devo
Posts: 8
Joined: May 1st, 2020, 8:17 pm

Re: HotKey plugin 1.0

Post by Devo »

balala wrote: October 20th, 2021, 6:15 pm Obviously you can use any solution you like more, however I'm not entirely sure you didn't miss my post, which explains why my code didn't work.
I was able to get your code working, so thanks for following up. Going back and forth between the codes provided, the both function as intended. While I agree with death.coder that it is a bit more complicated to set actions through actions, it is slightly more configurable by allowing the user to set multiple IfConditions (I think this portion is more logical at least to me). Since I may be adding some additional conditions I think I'll use the code you provided moving forward.

I want to thank both of you though for your help, your different approaches to the logic have helped me with this and will help me with other skins I'm working on as well. Thanks again.
User avatar
balala
Rainmeter Sage
Posts: 13533
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

Devo wrote: October 20th, 2021, 7:31 pm I was able to get your code working, so thanks for following up. Going back and forth between the codes provided, the both function as intended. While I agree with death.coder that it is a bit more complicated to set actions through actions, it is slightly more configurable by allowing the user to set multiple IfConditions (I think this portion is more logical at least to me). Since I may be adding some additional conditions I think I'll use the code you provided moving forward.

I want to thank both of you though for your help, your different approaches to the logic have helped me with this and will help me with other skins I'm working on as well. Thanks again.
I'm glad. Note that as I said previously, there is nothing wrong with none of those codes. Both are (probably) working, even if i didn't tried out death.crafter's (not death.coder's) last code, but I'm sure it is alright. Obviously you can use the one you like more, I can't, but even if I could, I still wouldn't force my code to anyone.
Glad you got it working as expected. :great:
User avatar
death.crafter
Rainmeter Sage
Posts: 1208
Joined: April 24th, 2021, 8:13 pm

Re: HotKey plugin 1.0

Post by death.crafter »

balala wrote: October 20th, 2021, 6:40 pm Not sure what do you want to demonstrate with this code. It doesn't contain a HotKey plugin measure, so what's the point?
Don't all sections work similarly?

With the SetOption bang, Dynamicvariables is momentarily forced on the section and the option is set. Also, there is a default value for each option available, so all available options are always there, you define it or not. So, I don't think it matters if it's HotKey plugin or any other measure or meter.

But if you say that it doesn't work like that for HotKey plugin then there is something wrong with it.
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 13533
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

death.crafter wrote: October 21st, 2021, 3:34 am With the SetOption bang, Dynamicvariables is momentarily forced on the section and the option is set. Also, there is a default value for each option available, so all available options are always there, you define it or not. So, I don't think it matters if it's HotKey plugin or any other measure or meter.

But if you say that it doesn't work like that for HotKey plugin then there is something wrong with it.
Yep, I know doesn't make too much sense, doesn't for me either. However this is what I found. Additionally as far as I can say, not quite all options have a default value. Otherwise in any other case (on any other type of meter and measure and on any other option) it does work. But still sustain: if the HotKey plugin measure doesn't have an explicitly set a KeyDownAction option, you can't simply set it through a !SetOption bang (well, in fact you can, but won't work). Recommend you to try it out, by seeing my sample code.
User avatar
death.crafter
Rainmeter Sage
Posts: 1208
Joined: April 24th, 2021, 8:13 pm

Re: HotKey plugin 1.0

Post by death.crafter »

balala wrote: October 21st, 2021, 7:04 am Yep, I know doesn't make too much sense, doesn't for me either. However this is what I found. Additionally as far as I can say, not quite all options have a default value. Otherwise in any other case (on any other type of meter and measure and on any other option) it does work. But still sustain: if the HotKey plugin measure doesn't have an explicitly set a KeyDownAction option, you can't simply set it through a !SetOption bang (well, in fact you can, but won't work). Recommend you to try it out, by seeing my sample code.
Ahh sorry, I should have tried that before.

May be Brian needs to recheck or explain this behaviour.
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 13533
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

death.crafter wrote: October 21st, 2021, 11:03 am Ahh sorry, I should have tried that before.

May be Brian needs to recheck or explain this behaviour.
Agree. Let's see if he'll react. However finally it's not a big deal, but I'd curious about an explanation.