Toggle keys with one shortcut

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Bnich0330
Posts: 1
Joined: 21 Jun 2021, 06:07

Toggle keys with one shortcut

21 Jun 2021, 06:12

I have a program where I routinely use F1, F2, F3, F4 and F5. I would like to have a single keyboard shortcut that toggles between these. Then I can map that new keyboard shortcut to my mouse and use a single mouse button to toggle between these “F” keys. Is that possible? And if so, how would I begin?
User avatar
mikeyww
Posts: 26888
Joined: 09 Sep 2014, 18:38

Re: Toggle keys with one shortcut

21 Jun 2021, 06:52

Code: Select all

F6::Send % "{F" (n ? Mod(n++, 5) + 1 : n := 1) "}"
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Toggle keys with one shortcut

21 Jun 2021, 11:28

Hallo,
or without ternary:

Code: Select all

F6::Send,% "{F" (++n := Mod(0 n, 5)) "}"

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: doodles333 and 286 guests