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.
It is currently November 29th, 2023, 4:53 am
HotKey plugin 1.0
-
- Posts: 1
- Joined: January 26th, 2020, 1:14 pm
-
- Rainmeter Sage
- Posts: 15813
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
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"]
- 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.
-
- Posts: 3
- Joined: May 1st, 2020, 5:19 am
Re: HotKey plugin 1.0
I was curious how to toggle on/off a specific skin with a keypress (CTRL ALT L). I see how to shift between layouts and have used that as a workaround, but it's just to toggle on/off Rento\Song Info.
Is this difficult to do?
Is this difficult to do?
-
- Rainmeter Sage
- Posts: 15813
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
No, it can easily be done, however there is a question: what do you mean by toggle on/off a skin? Because it can be loaded / unloaded or shown / hidden on the keypress. If you load, then unload a skin, as it says, after the unload the skin is closed and doesn't run, but if you just hide it, it still runs, it's just not visible on the screen (as I hope you figured it out, the skin is hidden), but the measures are still working, for instance the Counter function still counts.
So here is a solution for the first case, when you want to load / unload the skin:
Code: Select all
[MeasureToggle]
Measure=Plugin
Plugin=HotKey
HotKey=CTRL ALT L
KeyDownAction=[!ToggleConfig "CONFIG" "INI-FILE.ini"]
If on the other hand, you wanna just show / hide the skin, you have to replace the KeyDownAction option of the above measure with the following one: KeyDownAction=[!ToggleFade "CONFIG"]. Note that in this case the skin has to be loaded, the measure will just hide / show it. If the skin is not loaded, the above measure won't work, hitting the appropriate keys won't have any consequences, except some error messages in the log.
-
- Posts: 3
- Joined: May 1st, 2020, 5:19 am
Re: HotKey plugin 1.0
Fantastic. Thank you so much for your help!
-
- Rainmeter Sage
- Posts: 15813
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: HotKey plugin 1.0
I assume you've succeeded getting it to work, right?
-
- Posts: 3
- Joined: May 1st, 2020, 5:19 am
Re: HotKey plugin 1.0
Yep. Worked great. Appreciate ya.
-
- Rainmeter Sage
- Posts: 15813
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 17
- Joined: July 15th, 2020, 6:37 am
Re: HotKey plugin 1.0
Curious if this plugin ever got support for only responding to hotkeys when the skin has focus.
I'd like to add hotkeys to my launcher so that I don't have to click the meter's icon to launch the corresponding program. However, I use lots of different hotkeys inside of vim and other programs, so I need it to only work when the skin has focus.
Something like this...
Anyone know of a way to do this? I'm thinking I won't be able to trigger the LeftMouseUpAction directly, so I'll probably have to copy the action to the Hotkey block or assign it to a common variable.
I'd like to add hotkeys to my launcher so that I don't have to click the meter's icon to launch the corresponding program. However, I use lots of different hotkeys inside of vim and other programs, so I need it to only work when the skin has focus.
Something like this...
Code: Select all
[HotKey-Vim]
Measure = Plugin
Plugin = HotKey
HotKey = 1
KeyUpAction = $Trigger LeftMouseUpAction of 'MeterVim'
--- snip ---
[MeterVim]
Meter = Image
...
LeftMouseUpAction = ["#PROGRAMPATH#..\PortableGit\Vim-Wrapper.exe"]#skins_bottom#
-
- Posts: 92
- Joined: July 18th, 2020, 1:23 am
- Location: California
Re: HotKey plugin 1.0
Can try this example using OnFocusAction= and OnUnfocusAction=.
Ignore the extraneous -1 Update or UpdateDivider if needed, am just used to placing that.
Ignore the extraneous -1 Update or UpdateDivider if needed, am just used to placing that.
Code: Select all
[Rainmeter]
Update=-1
AccurateText=1
DynamicWindowSize=1
OnFocusAction=[!CommandMeasure measureHotkey Start][!SetOption MeterText FontColor 255,255,255][!UpdateMeter *][!Redraw]
OnUnfocusAction=[!CommandMeasure measureHotkey Stop][!SetOption MeterText FontColor 128,128,128][!UpdateMeter *][!Redraw]
[measureHotkey]
Measure=Plugin
Plugin=Hotkey
Hotkey=1
ShowAllKeys=1
KeyDownAction=[!SetOption MeterText SolidColor 0,100,0][!UpdateMeter *][!Redraw]
KeyUpAction=[!SetOption MeterText SolidColor 0,0,0][!UpdateMeter *][!Redraw]
UpdateDivider=-1
[MeterText]
Meter=String
FontSize=12
StringAlign=CenterCenter
FontColor=128,128,128
SolidColor=0,0,0
Text=Text
X=50
Y=25
W=100
H=50
You do not have the required permissions to view the files attached to this post.