Page 7 of 17

Re: HotKey plugin 1.0

Posted: May 9th, 2017, 4:25 am
by Leaversa
I need help on getting the mouse buttons to work.
Can I get example code of one of the mouse buttons?

Re: HotKey plugin 1.0

Posted: May 9th, 2017, 5:05 am
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

Re: HotKey plugin 1.0

Posted: December 11th, 2017, 6:39 pm
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?

Re: HotKey plugin 1.0

Posted: December 11th, 2017, 10:57 pm
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


Re: HotKey plugin 1.0

Posted: December 12th, 2017, 7:36 pm
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


Re: HotKey plugin 1.0

Posted: December 13th, 2017, 12:30 am
by eclectic-tech
Happy to help! :)

Re: HotKey plugin 1.0

Posted: December 22nd, 2017, 4:14 pm
by markpud
Apologies for the delayed reply, but this worked a treat.. Thanks again!

Re: HotKey plugin 1.0

Posted: February 12th, 2019, 2:27 am
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:

Re: HotKey plugin 1.0

Posted: December 19th, 2019, 10:01 pm
by Krainz
Unless I'm doing something wrong, ToggleMeasureGroup, PauseMeasureGroup and TogglePauseMeasureGroup don't seem to work with HotKey plugin measures.

Re: HotKey plugin 1.0

Posted: December 20th, 2019, 7:17 pm
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.