Cycle different lists while ctrl held, multiple loops with tooltip

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Pirate507
Posts: 1
Joined: 12 Mar 2017, 18:59

Cycle different lists while ctrl held, multiple loops with tooltip

11 Dec 2017, 01:38

Hello World!

I'm an absolute amateur when it comes to AHK and while I've managed to wrap my head around most of the logic and syntax, this one problem keeps tripping me up something fierce.

I'm looking to cycle different lists while a modifier key is held down, similar to how clipjump (http://clipjump.sourceforge.net/) works with cycling through paste selections. I just can't figure out how to tear enough Franken-code out of it to apply to my problem.

I'm trying to make "n" number of lists that I can populate as arrays with strings (but if there's a better way, please do let me know!) :

Code: Select all

list1 = ["hello", "hi there", "greetings!"]
list2 = ["goodbye", "see you soon", "take care!"]
Then, call up those lists with ctrl + [ListHotkey1] or ctrl + [ListHotKey2], cycling through the arrays with additional presses of [ListHotkeyN], using a tooltip to show the contents of the the string that will send (using %A_INDEX% pointer?). Releasing ctrl would then send the string selected (showing via tooltip) and clear the tooltip. Swapping between [ListHotkey1] and [ListHotKey2] while ctrl is held should reset the counter and break the selection loop each time and always start the selection from the beginning of the array.

I'm struggling to figure out how to:

- Get this to work in a While(get keystate) statement for when ctrl is held. I thought Keywait would be the answer, but I'm pretty sure I need a delay between [ListHotKey] presses; a single tap adds a count per ms, whipping through my selection too fast. I find this method unreliable for when I want to cycle selections very quickly.
- Break the loops and reset the counter to swap between lists without releasing ctrl, and
- Ensure this macro is scale-able (since I intend on having 9+ arrays and hotkeys).

I've made about 5 or 6 attempts at this now, scoured the helpdoc, hunted through the forums, and nothing is working. I'm not even sure I'm on the right track anymore. Any advice, tips, guidance, other threads, or code would be greatly appreciated!

Thanks in advance, everyone :)
-Pirate

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: just me, Oblomov228, OrangeCat, Perpendie, piddly and 250 guests