AutoHotkey usage
Using .ahk files in a module
The following guide will show you how you can use AHK to run 2 toggling bangs by pressing a hotkey for your module. Of course, this isn't what AHK is limited to do, as demonstrated by the YourFlyouts module.
Getting started
Create file ./@Resources/Actions/Source code/#SKINNAME#.ahk
#SingleInstance Force
#NoTrayIcon
SetTitleMatchMode, 2
DetectHiddenWindows, On
IniRead, OutputVar, Hotkeys.ini, Variables, Key
IniRead, RainmeterPath, Hotkeys.ini, Variables, RMPATH
Hotkey,%OutputVar%,Button
Return
Button:
Run "%RainmeterPath% "!UpdateMeasure "mToggle" "#SKINNAME#\Main" "
ReturnAnd create file ./@Resources/Actions/Source code/Close.ahk
And finally, create file ./@Resources/Actions/Hotkeys.ini
🎉Congratulations! All necessary files have been created. Lets move on to the code part...
Assigning default values
As you can see, in Hotkeys.ini the values are blank. We'll have to assign a default value first.
You can either put these values in the file, to make the default hotkey
LWin WOr you can visit your settings page (if you made one) and change the hotkey.
Open the
@Startskin from the Rainmeter manage panel.
Integration to your module
As you've read about themToggle measure, lets use that to toggle our module.
Paste the 2 blocks into your main skin file.
Add the following contents to the
[Rainmeter]section:This allows the module to:
Always stay on top of other windows
Launch the ahk process when the module is activated
Dismiss on unfocus
Close all ahk process when the module exits
Create 2 NUOL measures:
ACTIONLOAD&ACTIONUNLOAD, and have theirOnUpdateActionbe whatever you want
Last updated
Was this helpful?