It is currently February 29th, 2020, 3:45 am

HotKey plugin 1.0

Plugins and Addons popular with the Community
copystring
Posts: 1
Joined: January 26th, 2020, 1:14 pm

Re: HotKey plugin 1.0

Post by copystring »

Hey, I'm trying to bind LCTRL+LALT+mouse wheel up /mouse wheel down.
This is not supported, right? Haven't found the key on the Microsoft site.
User avatar
balala
Rainmeter Sage
Posts: 9799
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

copystring wrote:
January 26th, 2020, 1:16 pm
This is not supported, right?
Well, it is and it's not.
Here is what am i talking about: you can easily take an action when LCtrl and / or LAlt is pressed, however detecting the mouse wheel scroll, this is a little bit more difficult. Not completely impossible, but there is a limitation.
Here is a sample code, based on the code of the example skin (HotKey_1.0.0.12.rmskin) posted here:

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=#BackgroundColor#

[Variables]
BackgroundColor=50,50,50,255
Key1=LCTRL LALT
LCtrlAlt=0

[MeasureLCtrlLAlt]
Measure=Plugin
Plugin=HotKey
HotKey=#Key1#
KeyDownAction=[!SetVariable LCtrlAlt "1"][!UpdateMeasure "MeasureAction"]
KeyUpAction=[!SetVariable LCtrlAlt "0"][!SetVariable MouseScroll "0"][!UpdateMeasure "MeasureAction"]

[MeasureAction]
Measure=Calc
Formula=( #LCtrlAlt# * #MouseScroll# )
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!SetOption Background SolidColor "#BackgroundColor#"][!UpdateMeter Background][!Redraw]
IfFalseAction=[!SetOption Background SolidColor "255,0,0"][!UpdateMeter Background][!Redraw]
DynamicVariables=1

[Background]
Meter=Image
SolidColor=#BackgroundColor#
X=0
Y=0
W=200
H=90
MouseScrollUpAction=[!SetVariable MouseScroll "1"][!UpdateMeasure "MeasureAction"]
MouseScrollDownAction=[!SetVariable MouseScroll "1"][!UpdateMeasure "MeasureAction"]
This works, however
  • The mouse wheel scrolling is detected only when you're scrolling over the skin. Scrolling elsewhere is not detected.
  • The skin detects when you1re holding the appropriate keys and you're scrolling (in the same time), however if you scroll first over the skin and you press the LCtrl + LAlt later, the skin detects the action. After releasing the LCtrl + LAlt, the action isn't detected once again, even if you press the keys again.
Unfortunately me personally don't see a way to make exactly what have you described, better than this.