Hello all! Thanks for taking the time to read this!
I'm an amateur programmer and I'm having a bit of trouble with autohotkey. I have a script that runs in the background, and when I enter certain 'modes' (like the capslock is on) it becomes Vim-like. Pressing "h" moves my cursor left, "l" moves my cursor right, etc.
I'm trying to implement another Vim-like feature — the 'f' key. The problem is, in Vim, if you were to type "fa" it would search to the right of the cursor until it hits the end of the line or finds the next "a" in the sentence. I understand algorithmically what to do, but I don't know how to store the variable when it could be anything. how can I distinguish between the examples below?
fa
fb
fc
...
f!
f@
f$
...
f0
f1
f2
...
etc
My other hotkeys work something like this:
h:: if (CAPS_MODE == true) Send, {Left} else if (NUM_MODE == true) Send, !^s else Send, h return
and I assume the one I'm trying to make needs to work something like this:
f:: ;wait for next keypress ;store keypress in variable ;search remainder of sentence until variable matches or you hit end of sentence return
Thanks for the help, I really appreciate the feedback!
-PTG