It is currently March 28th, 2024, 7:25 pm

HotKey plugin 1.0

Plugins and Addons popular with the Community
Leaversa
Posts: 3
Joined: March 11th, 2017, 10:27 pm

Re: HotKey plugin 1.0

Post by Leaversa »

I need help on getting the mouse buttons to work.
Can I get example code of one of the mouse buttons?
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: HotKey plugin 1.0

Post by Brian »

Leaversa wrote:I need help on getting the mouse buttons to work.
Can I get example code of one of the mouse buttons?
Mouse buttons only work in combination with other non-mouse keys.
https://github.com/brianferguson/HotKey.dll/blob/master/README.md#pre-defined-hotkey-keywords

There is an example using a mouse key in the hotkey docs:
https://github.com/brianferguson/HotKey.dll/blob/master/README.md#user-content-examples

Or a simple example here:

Code: Select all

[LeftMouseSpacebarHotkey]
Measure=Plugin
Plugin=HotKey
HotKey="SPACE LBUTTON"
KeyDownAction=[!SomeBang ...]
(Obviously !SomeBang ... will need to be the action you want to take when the spacebar and left mouse button are both at the 'down' state.)

-Brian
markpud
Posts: 9
Joined: December 11th, 2017, 6:35 pm

Re: HotKey plugin 1.0

Post by markpud »

Hi,
Please could someone help with newb advice on how to use this plugin to trigger change of Rainmeter layout via a hotkey combo e.g. CTRL-ALT-A or Windows-CTRL-1 etc?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: HotKey plugin 1.0

Post by eclectic-tech »

markpud wrote:Hi,
Please could someone help with newb advice on how to use this plugin to trigger change of Rainmeter layout via a hotkey combo e.g. CTRL-ALT-A or Windows-CTRL-1 etc?
You need to create a skin with the following code. Name it anything you want and save it in a new SKINS folder. Refresh Rainmeter and load this new skin. You will not see anything new on the screen, but it will be listed under active skins in the Manage dialog.

It uses CTRL ALT L as the hotkey combination to step through 3 layouts Elementary, illustro, Enigma Basic, and back to Elementary.

You can set the variables to step through any number of layouts, from 2 to as many layouts as you want.
To toggle between the current layout and another layout, set Layout0=@Backup and Layout1=anotherlayout and NumberOfLayouts=2.

NOTES:
1. In order for this to work, you MUST load this SAME SKIN into those layouts and re-save the layouts; that way this skin is included in those layouts and is ready to switch on the next layout when the hotkey combination is pressed.

2. Requires Rainmeter-4.1-r2876-beta minimum due to nested variable use.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=You must add this SAME SKIN to every layout you set in the [Variables] otherwise it is not available and will not work. Requires Rainmeter-4.1-r2876-beta minimum due to nested variable use.
License=Creative Commons Share-Alike NC 4
Version=

; ========= Variables ==========
[Variables]
; Set this to the number of layouts you want to step through with each Hotkey press
NumberOfLayouts=3
CurrentLayoutNumber=0
; Add your layouts starting at zero
Layout0=Elementary
Layout1=illustro
Layout2=Enigma Basic

; ========= Measures ==========
[Hotkey]
Measure=Plugin
Plugin=HotKey
HotKey=CTRL ALT L
KeyDownAction=[!WriteKeyValue Variables CurrentLayoutNumber (([#CurrentLayoutNumber]+1)%[#NumberOfLayouts])][!SetVariable CurrentLayoutNumber (([#CurrentLayoutNumber]+1)%[#NumberOfLayouts])][!LoadLayout [#Layout[#CurrentLayoutNumber]]]


; ========= Meter Styles =========


; ========= Meters ==========
[DummyMeter]
Meter=String

markpud
Posts: 9
Joined: December 11th, 2017, 6:35 pm

Re: HotKey plugin 1.0

Post by markpud »

Thanks! I'll give it a go :thumbup:
eclectic-tech wrote:You need to create a skin with the following code. Name it anything you want and save it in a new SKINS folder. Refresh Rainmeter and load this new skin. You will not see anything new on the screen, but it will be listed under active skins in the Manage dialog.

It uses CTRL ALT L as the hotkey combination to step through 3 layouts Elementary, illustro, Enigma Basic, and back to Elementary.

You can set the variables to step through any number of layouts, from 2 to as many layouts as you want.
To toggle between the current layout and another layout, set Layout0=@Backup and Layout1=anotherlayout and NumberOfLayouts=2.

NOTES:
1. In order for this to work, you MUST load this SAME SKIN into those layouts and re-save the layouts; that way this skin is included in those layouts and is ready to switch on the next layout when the hotkey combination is pressed.

2. Requires Rainmeter-4.1-r2876-beta minimum due to nested variable use.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

; ========= Metadata ==========
[Metadata]
Name=
Author=
Information=You must add this SAME SKIN to every layout you set in the [Variables] otherwise it is not available and will not work. Requires Rainmeter-4.1-r2876-beta minimum due to nested variable use.
License=Creative Commons Share-Alike NC 4
Version=

; ========= Variables ==========
[Variables]
; Set this to the number of layouts you want to step through with each Hotkey press
NumberOfLayouts=3
CurrentLayoutNumber=0
; Add your layouts starting at zero
Layout0=Elementary
Layout1=illustro
Layout2=Enigma Basic

; ========= Measures ==========
[Hotkey]
Measure=Plugin
Plugin=HotKey
HotKey=CTRL ALT L
KeyDownAction=[!WriteKeyValue Variables CurrentLayoutNumber (([#CurrentLayoutNumber]+1)%[#NumberOfLayouts])][!SetVariable CurrentLayoutNumber (([#CurrentLayoutNumber]+1)%[#NumberOfLayouts])][!LoadLayout [#Layout[#CurrentLayoutNumber]]]


; ========= Meter Styles =========


; ========= Meters ==========
[DummyMeter]
Meter=String

User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: HotKey plugin 1.0

Post by eclectic-tech »

Happy to help! :)
markpud
Posts: 9
Joined: December 11th, 2017, 6:35 pm

Re: HotKey plugin 1.0

Post by markpud »

Apologies for the delayed reply, but this worked a treat.. Thanks again!
User avatar
raiguard
Posts: 660
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: HotKey plugin 1.0

Post by raiguard »

Sorry to gravedig this thread, but I have a feature request: Could the string value of the measure be set to the hex ID of the last pressed key, when ShowAllKeys is enabled? I wish to be able to make a config interface for some hotkeys in one of my skins, but currently there is no way to do this aside from having the user manually open the log and copy the hex IDs to text boxes. Ideally, I would want the user to be able to click a button, and for me to be able to read the key(s) that have been pressed, then save it when the combo is released (this is similar to how many video games and keyboard macro recorders do it).

Thanks for your time. Great plugin, it's very useful and functional! :thumbup:
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
Krainz
Posts: 186
Joined: May 27th, 2012, 5:16 am

Re: HotKey plugin 1.0

Post by Krainz »

Unless I'm doing something wrong, ToggleMeasureGroup, PauseMeasureGroup and TogglePauseMeasureGroup don't seem to work with HotKey plugin measures.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: HotKey plugin 1.0

Post by balala »

Krainz wrote: December 19th, 2019, 10:01 pm Unless I'm doing something wrong, ToggleMeasureGroup, PauseMeasureGroup and TogglePauseMeasureGroup don't seem to work with HotKey plugin measures.
No, they are not, but as you seen there is another way to disable this kind of measure.