How to use modifier(s) + semicolon (;) to trigger a hotkey?

Get help with using AutoHotkey and its commands and hotkeys
jmhman
Posts: 2
Joined: 09 Jan 2015, 13:29

How to use modifier(s) + semicolon (;) to trigger a hotkey?

09 Jan 2015, 13:38

I know I can escape the semicolon

Code: Select all

';::msgbox boom-hotkey!
or use the scancode

Code: Select all

sc0027::msgbox boom-hotkey!
but neither of those seems to work with modifiers.

Specifically, I want to make +^; a hotkey trigger. I've googled and searched the forums here and at autohotkey.com and come up with nothing.

Is this possible?
User avatar
flyingDman
Posts: 172
Joined: 29 Sep 2013, 19:01
Location: Burbank, California

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

09 Jan 2015, 17:22

Create a separate script:

Code: Select all

#CommentFlag //
+^;::msgbox boom-hotkey!
User avatar
Nextron
Posts: 1360
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

09 Jan 2015, 17:54

^+sc027::msgbox boom-hotkey! does work for me. Are you using the latest version from this website?
lexikos
Posts: 6397
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

10 Jan 2015, 02:57

You don't need #CommentFlag or sc027.

There's nothing to it; just write the hotkey.

Code: Select all

+;::MsgBox
You can even write +`; if you want, but it's not necessary because ; comments require a leading space or tab if they aren't at the beginning of the line.

You can even write :::MsgBox.

These even work in ancient versions of AutoHotkey.
jmhman
Posts: 2
Joined: 09 Jan 2015, 13:29

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

15 Jan 2015, 11:12

I'm not sure what my issue is. It must be something about my primary script, as I was able to get Lexikos' solution to work (once I took out the leading tab on the line I usually use), but only in a fresh script. I can't seem to get it to work in my daily driver. The hotkey just seems not to trigger. I tried moving it to the top of the script to see if that might help, but it didn't. Any ideas? Anything I could look for that might keep it from working?
lexikos
Posts: 6397
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

15 Jan 2015, 16:48

It works with or without a leading tab.

Check ListHotkeys to see if the hotkey is listed and active, and KeyHistory after pressing +; to see how it registers.
AHKxx
Posts: 54
Joined: 26 Feb 2014, 01:37

Re: How to use modifier(s) + semicolon (;) to trigger a hotk

19 Feb 2015, 22:26

lexikos wrote: You can even write +`; if you want, but it's not necessary because ; comments require a leading space or tab if they aren't at the beginning of the line.

You can even write :::MsgBox.

These even work in ancient versions of AutoHotkey.
That's very useful to know.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], casperharkin, CuriousLy, Google [Bot], TAC109 and 163 guests