JaxCore
GithubWebsiteSupport Server
  • JaxCore - Documentation
  • 🚀Getting Started
    • Introduction
    • Installation
    • User Interface
    • Additional requisites
    • Changing global options
    • Uninstallation
    • FAQs
      • New user FAQs
      • JaxCore FAQs
      • Miscellaneous FAQs
      • Anti-virus, false positive FAQs
      • Modules FAQs
        • YourFlyouts
        • YourMixer
        • ValliStart
        • IdleStyle
        • Keylaunch
        • Keystrokes OSD
      • Widget FAQs
        • ModularClocks
        • ModularVisualizer
        • Plainext
      • Media Player FAQs
      • Performance FAQs
  • 📦Modules
    • Introduction
    • YourFlyouts
    • YourMixer
    • IdleStyle
    • ValliStart
  • 🌥️Widgets
    • Introduction
    • ModularClocks
    • ModularPlayers
    • ModularVisualizer
    • Overlayer
    • Plainext
    • FAQ
  • Coding a module
    • Code formatting
    • Variables
    • Dynamic & Reactive user interface
    • Measures
    • MeterStyles
    • AutoHotkey usage
    • CoreInstaller
Powered by GitBook
On this page
  • Getting started
  • Assigning default values
  • Integration to your module

Was this helpful?

Export as PDF
  1. Coding a module

AutoHotkey usage

Using .ahk files in a module

Replace all #SKINNAME# instances you see on this page with your module name

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" "
Return

And create file ./@Resources/Actions/Source code/Close.ahk

#NoTrayIcon

IniRead, OutputVar, CloseInstance.ini, Variables, Module

CloseScript(Name)
	{
	DetectHiddenWindows On
	SetTitleMatchMode RegEx
	IfWinExist, i)%Name%.* ahk_class AutoHotkey
		{
		WinClose
		WinWaitClose, i)%Name%.* ahk_class AutoHotkey, , 2
		If ErrorLevel
			return "Unable to close " . Name
		else
			return "Closed " . Name
		}
	else
		return Name . " not found"
	}

CloseScript("#SKINNAME#.ahk")
ExitApp

And finally, create file ./@Resources/Actions/Hotkeys.ini

[Variables]
Key=
RMPATH=
KeyInString=

Assigning default values

As you can see, in Hotkeys.ini the values are blank. We'll have to assign a default value first.

  1. You can either put these values in the file, to make the default hotkey LWin W

    Key=#W
    KeyInString=LWin W

    Or you can visit your settings page (if you made one) and change the hotkey.

  2. Open the @Start skin from the Rainmeter manage panel.

Integration to your module

This method works, but can be more efficient by the use of a lua script.

  1. Paste the 2 blocks into your main skin file.

  2. Add the following contents to the [Rainmeter] section:

    [Rainmeter]
    DefaultAlwaysOnTop=1
    OnRefreshAction=...["#@#Actions\AHKv1.exe" "#@#Actions\Source Code\#SKINNAME#.ahk"]
    OnUnfocusAction=[!UpdateMeasure mToggleSet]
    OncloseAction=["#@#Actions\AHKv1.exe" "#@#Actions\Source Code\Close.ahk"]

    This allows the module to:

    1. Always stay on top of other windows

    2. Launch the ahk process when the module is activated

    3. Dismiss on unfocus

    4. Close all ahk process when the module exits

PreviousMeterStylesNextCoreInstaller

Last updated 3 years ago

Was this helpful?

Congratulations! All necessary files have been created. Lets move on to the code part...

As you've read about the, lets use that to toggle our module.

Create 2 s: ACTIONLOAD & ACTIONUNLOAD, and have their OnUpdateAction be whatever you want

🎉
mToggle measure
NUOL measure