Page 1 of 1

Keyboard input

Posted: May 11th, 2017, 3:34 pm
by dooderman10
Is there any way that I can, let's say, press a rain meter button on my computer screen and have it press something like shift e? Thanks in advance.

Re: Keyboard input

Posted: May 11th, 2017, 3:39 pm
by balala
dooderman10 wrote:Is there any way that I can, let's say, press a rain meter button on my computer screen and have it press something like shift e? Thanks in advance.
Not sure what you mean by "rain meter button", but for this kind of task, you don't even need a lua script (that1s why I'm not sure why have you posted this question into the Lua scripting section). The only thing you need is the HotKey plugin.

Re: Keyboard input

Posted: May 11th, 2017, 7:24 pm
by dooderman10
balala wrote:Not sure what you mean by "rain meter button", but for this kind of task, you don't even need a lua script (that1s why I'm not sure why have you posted this question into the Lua scripting section). The only thing you need is the HotKey plugin.
First, I meant a button that I created for my desktop with rainmeter, second, I got it working.

Re: Keyboard input

Posted: May 11th, 2017, 8:21 pm
by balala
The following code will update the value of the Start variable, each time you're hitting the Shift + e keys (simultaneously):

Code: Select all

[Rainmeter]
Update=-1

[Variables]
E=0

[MeasureE]
Measure=Plugin
Plugin=HotKey
HotKey=SHIFT E
KeyDownAction=[!SetVariable E "(#E#+1)"][!UpdateMeasure "MeasureE"][!UpdateMeter "MeterE"][!Redraw]
DynamicVariables=1

[MeterE]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=14
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#E#
DynamicVariables=1
Note that this code will work ONLY if you install the HotKey plugin. As I also said in my last reply, you can download the plugin here. The easiest way for this is to download and install the HotKey_1.0.0.12.rmskin package, available in the post indicated above. This will install the skin and the appropriate version of the HotKey plugin. If you don't need the skin, you can simply remove it, the plugin will remain and will be usable. However, I'd recommend to take a look to the skin before you remove it, because you can see there how the plugin works.