Page 1 of 1

mode activation like vim

Posted: 03 Jun 2020, 08:49
by triven
Hi Everyone - Suppose I have complex key combination win+ctrl+x to cut and place text on stack. Now I have cut 15 texts. Pressing win+ctrl+x 15 times in quite time consuming and difficult. I am visualizing something like below.

Step1: Activate some sort of mode lets call in SpecialCutMode
Step2: Pressing . (period) trigger win+ctrl+x or maybe pressing some other key have a specific activation only only relevant while SpecialCutMode is active.
Step3: Exist SpecialCutMode mode

Any hints or guidance will be helpful.

Re: mode activation like vim

Posted: 03 Jun 2020, 09:49
by mshafer1
Check out Suspend command
Also for the number of times, you might find Loop helpful.

Something like this (untested):

Code: Select all

; toggle active or not on Win + p
#p::
	Suspend, Toggle
	if (A_IsSuspended)
		TrayTip, {Tool Name}, not active, 10, 1
	else
		TrayTip, {Tool Name}, Activated, 10, 1
	return

; . = Win + CTRL + X 15 times 
.::
	Loop, 15
	{
		Send, #^x
		Sleep, 500; delay 500 ms to let UI catch up
	}
	return
(update: re-read your post and realized you wanted to trigger on "." to call #^x, adjusted)