Variable as prefix for multiple hotkeys? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sorrynameused

Variable as prefix for multiple hotkeys?

12 Dec 2017, 06:32

So I'm trying to create numerous hotkeys, each made with a prefix + a letter ranging a-z
Thing is, I want to change the prefix without having to edit the entire damn alphabet.
So far I've been trying to use a variable as a hotkey, but it seems to stop working after the first hotkey, any way to fix this?

Example below

Prefix1 = RCtrl

Hotkey, %Prefix1% & a, test_a
Return

test_a:
MsgBox, test_a works
Return

Hotkey, %Prefix1% & b, test_b
Return

test_B:
MsgBox, test_b never works
Return
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: Variable as prefix for multiple hotkeys?  Topic is solved

12 Dec 2017, 07:28

Code: Select all

Prefix1 = RCtrl

Hotkey, %Prefix1% & a, test_a
Hotkey, %Prefix1% & b, test_b
Return

test_a:
MsgBox, test_a works
Return

test_B:
MsgBox, test_b never works
Return
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: WAZAAAAA and 398 guests