It is currently April 19th, 2024, 7:35 pm

Input Count Rainmeter skins

Get help with creating, editing & fixing problems with skins
Mekurukito
Posts: 21
Joined: July 8th, 2018, 6:09 am

Re: Input Count Rainmeter skins

Post by Mekurukito »

Mekurukito wrote: October 1st, 2019, 1:07 pm well its kinda not worth it if it can only do 1 meters for every click.
How about make a calculation on the variable? if i use the first meter and the second meter, like 1(first)+1(second)=2?

this the project that i want to do, its Key Counting
and well its not really work out, i cant do it using Hotkey Plugin, this is the code

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Count=0

[A_Key]
Measure=Plugin
Plugin=HotKey
HotKey=A
KeyDownAction=[!SetVariable Count "(#Count#+1)"][!UpdateMeter "#CURRENTSECTION#"][!UpdateMeter "MeterShowClicks"][!Redraw]
DynamicVariables=1

[MeterShowClicks]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Number of clicks so far:#CRLF##Count#
DynamicVariables=1
its working, but it has a bad delay, how do i make the update faster?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Input Count Rainmeter skins

Post by jsmorley »

Try setting your skin Update value much lower.

Code: Select all

[Rainmeter]
Update=16
Also, you don't need this [!UpdateMeter "#CURRENTSECTION#"]
Mekurukito
Posts: 21
Joined: July 8th, 2018, 6:09 am

Re: Input Count Rainmeter skins

Post by Mekurukito »

jsmorley wrote: October 1st, 2019, 2:23 pm Try setting your skin Update value much lower.

Code: Select all

[Rainmeter]
Update=16
yes finally i understand, how stupid am i ???

and thank you all for your help
User avatar
balala
Rainmeter Sage
Posts: 16146
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Input Count Rainmeter skins

Post by balala »

Mekurukito wrote: October 1st, 2019, 1:07 pm this the project that i want to do, its Key Counting
and well its not really work out, i cant do it using Hotkey Plugin, this is the code
The posted code counts the A key presses. No clicks are counted.
The HotKey plugin can't be used to count the mouse clicks, due to what is describe in the 7th Note here.
Mekurukito wrote: October 1st, 2019, 1:07 pm well its kinda not worth it if it can only do 1 meters for every click.
How about make a calculation on the variable? if i use the first meter and the second meter, like 1(first)+1(second)=2?
I definitely didn't understand what calculation do you want to make. Give me a few details, please.
User avatar
balala
Rainmeter Sage
Posts: 16146
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Input Count Rainmeter skins

Post by balala »

jsmorley wrote: October 1st, 2019, 2:23 pm Try setting your skin Update value much lower.

Code: Select all

[Rainmeter]
Update=16
Also, you don't need this [!UpdateMeter "#CURRENTSECTION#"]
I doubt setting the Update so low is a good idea. Also removing the [!UpdateMeter "#CURRENTSECTION#"] bang won't help. This bang on the initial code has been added to a meter, but in the meantime Mekurukito has moved it into a measure. So Mekurukito, don't remove it but replace it with [!UpdateMeasure "#CURRENTSECTION#"]. As you can see the initial !UpdateMeter bang is now replaced by a !UpdateMeasure bang, because [A_Key] is a measure, not a meter, so you have to update it as measure, using the !UpdateMeasure bang, not as meter with a !UpdateMeter. You can realize this easily if you take a look to the log, where if the initial !UpdateMeter bang is used a !UpdateMeter: [A_Key] not found message can be seen. This means that the !UpdateMeter bang has been applied either to a not existing meter, or to a measure. This last one is your case.
Mekurukito
Posts: 21
Joined: July 8th, 2018, 6:09 am

Re: Input Count Rainmeter skins

Post by Mekurukito »

one more help that i need to do.
how do you make the count result showing after a period of time like,
in 1 minute i click 10 times and then it will show result after 1 minute over and it not going to show the 1-9 result but only show the last result for every 1 minutes

by doing this it can reduce the cpu processing, if i use to many meters update using actiontimer the cpu processing is increasing so high that it cannot handle my pc, so that why i want to do it simple
Mekurukito
Posts: 21
Joined: July 8th, 2018, 6:09 am

Re: Input Count Rainmeter skins

Post by Mekurukito »

okay a new problem has been found.

the code is working fine but it has a downside and that is when you hold the KeyDownAction it will spam the result.
what i want is 1 KeyDownAction = 1 result, but if i hold the KeyDownAction it will spam and i have no idea to fix this

Code: Select all


[Rainmeter]
Update=10

[Variables]
Count=0

[A_Key]
Measure=Plugin
Plugin=HotKey
HotKey=A
KeyDownAction=[!SetVariable Count "(#Count#+1)"]
KeyUpAction=[!UpdateMeasure "A_key"][!UpdateMeter "Total_press"]
DynamicVariables=1

[B_Key]
Measure=Plugin
Plugin=HotKey
HotKey=B
KeyDownAction=[!SetVariable Count "(#Count#+1)"]
KeyUpAction=[!UpdateMeasure "B_key"][!UpdateMeter "Total_press"]
DynamicVariables=1

[Total_press]
Meter=STRING
X=100
Y=25
FontColor=50,50,50,255
FontSize=12
FontFace=HelveticaRounded LT Std BD
StringAlign=CENTER
AntiAlias=1
Text=Total:#CRLF##Count#
DynamicVariables=1

i already try to make DynamicVariables=0 but it wont work for a multiple meter like this one
User avatar
balala
Rainmeter Sage
Posts: 16146
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Input Count Rainmeter skins

Post by balala »

Mekurukito wrote: October 2nd, 2019, 10:59 am the code is working fine but it has a downside and that is when you hold the KeyDownAction it will spam the result.
what i want is 1 KeyDownAction = 1 result, but if i hold the KeyDownAction it will spam and i have no idea to fix this
I'd move the !SetVariable bang from the KeyDownAction option to KeyUpAction. This way even if hold the key, this won't be registered until you're releasing it.

Code: Select all

[A_Key]
Measure=Plugin
Plugin=HotKey
HotKey=A
;KeyDownAction=
KeyUpAction=[!SetVariable Count "(#Count#+1)"][!UpdateMeasure "A_key"][!UpdateMeter "Total_press"]
DynamicVariables=1

[B_Key]
Measure=Plugin
Plugin=HotKey
HotKey=B
;KeyDownAction=
KeyUpAction=[!SetVariable Count "(#Count#+1)"][!UpdateMeasure "B_key"][!UpdateMeter "Total_press"]
DynamicVariables=1
Mekurukito wrote: October 2nd, 2019, 10:59 am i already try to make DynamicVariables=0 but it wont work for a multiple meter like this one
Both measures and the meter as well are using the dynamically set Count variable, so you can't remove or set to 0 the DynamicVariables option.
Mekurukito
Posts: 21
Joined: July 8th, 2018, 6:09 am

Re: Input Count Rainmeter skins

Post by Mekurukito »

balala wrote: October 2nd, 2019, 12:04 pm I'd move the !SetVariable bang from the KeyDownAction option to KeyUpAction. This way even if hold the key, this won't be registered until you're releasing it.

Code: Select all

[A_Key]
Measure=Plugin
Plugin=HotKey
HotKey=A
;KeyDownAction=
KeyUpAction=[!SetVariable Count "(#Count#+1)"][!UpdateMeasure "A_key"][!UpdateMeter "Total_press"]
DynamicVariables=1

[B_Key]
Measure=Plugin
Plugin=HotKey
HotKey=B
;KeyDownAction=
KeyUpAction=[!SetVariable Count "(#Count#+1)"][!UpdateMeasure "B_key"][!UpdateMeter "Total_press"]
DynamicVariables=1
Both measures and the meter as well are using the dynamically set Count variable, so you can't remove or set to 0 the DynamicVariables option.
NICE solution,
i never think about that before

i just found the reason why the cpu usage is increasing so fast,
is it because i hold KeyDownAction that spamming the actions every second,
Or my PC just having a bad day?
User avatar
balala
Rainmeter Sage
Posts: 16146
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Input Count Rainmeter skins

Post by balala »

Mekurukito wrote: October 2nd, 2019, 2:52 pm i just found the reason why the cpu usage is increasing so fast,
is it because i hold KeyDownAction that spamming the actions every second,
More frequently I think than once per second. Especially that you've set the Update value of your skin to 10. Note that this is wrong, the lowest possible value is 16 (second paragraph here).
Mekurukito wrote: October 2nd, 2019, 2:52 pm Or my PC just having a bad day?
I don't think so.