It is currently December 12th, 2018, 4:07 am

HotKey plugin 1.0

Share your custom plugins and applications to enhance Rainmeter.
Leaversa
Posts: 3
Joined: March 11th, 2017, 10:27 pm

Re: HotKey plugin 1.0

Leaversa » May 9th, 2017, 4:25 am

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: 1793
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: HotKey plugin 1.0

Brian » May 9th, 2017, 5:05 am

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: 3
Joined: December 11th, 2017, 6:35 pm

Re: HotKey plugin 1.0

markpud » December 11th, 2017, 6:39 pm

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: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: HotKey plugin 1.0

eclectic-tech » December 11th, 2017, 10:57 pm

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: 3
Joined: December 11th, 2017, 6:35 pm

Re: HotKey plugin 1.0

markpud » December 12th, 2017, 7:36 pm

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: 3050
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: HotKey plugin 1.0

eclectic-tech » December 13th, 2017, 12:30 am

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

Re: HotKey plugin 1.0

markpud » December 22nd, 2017, 4:14 pm

Apologies for the delayed reply, but this worked a treat.. Thanks again!