Can't figure out what is mess with my modifiers and lagging my computer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pivotphone
Posts: 18
Joined: 03 Sep 2022, 12:09

Can't figure out what is mess with my modifiers and lagging my computer

Post by pivotphone » 21 Sep 2022, 04:46

Hi everyone, I have made a script that allows me to;

Highlight and waits for a Copy+C to copy and paste into a excel sheet, along with this there are following tooltips that reminds the user what they are copying.

Unfortunately it seems to be messing with my modifiers stopping me from scrolling on chrome and clicking in excel but just can't find the problem. In addition to this, it can intermittently lag my computer to the point i have to turn off and on.

All of this is happening intermittently and can't pin it down.

I also have two functions, the tooltip follower and an attempt and checking for modifiers and releasing them but thats not working (Code at the bottom)

Anyone that can help would be greatly appreciated!

Code: Select all

f4::


;Model

	;Following ToolTip
		Text = Model
		End := A_TickCount + 5000
		SetTimer, FollowingTooltip, 50	


		;Copy & Pasting
		KeyWait, C, D ; Looking for {C} down {d}
		sleep 50
		Send, {LControl Down}{l}{LControl Up}
		sleep 50
		Send, {LControl Down}{v}{LControl Up}
		sleep 50
		Send, {LControl Down}{a}{LControl Up}
		sleep 50
		Send, {LControl Down}{c}{LControl Up}
		sleep 50
		WinActivate, WP Import Master - Zebra - Excel ahk_exe EXCEL.EXE
		sleep 100
		send, {f2}
		sleep 50
		Send, {LControl Down}{v}{LControl Up}
		sleep 50
		send, {enter}
		sleep 50
		Send, {right 6}
		sleep 50
		Send, {up}
		sleep 50
		send, {f2}
		sleep 50
		Send, {LControl Down}{v}{LControl Up}
		sleep 50
		send, {enter}
		sleep 50
		Send, {right 1}
		sleep 50
		Send, {up}	
		
		;SubTitle

	;Following ToolTip
		Text = SubTitle
		End := A_TickCount + 5000
		SetTimer, FollowingTooltip, 50	


		;Copy & Pasting
		KeyWait, C, D ; Looking for {C} down {d}
		sleep 100
		Send, {LControl Down}{l}{LControl Up}
		sleep 100
		Send, {LControl Down}{v}{LControl Up}
		sleep 100
		Send, {LControl Down}{a}{LControl Up}
		sleep 100
		Send, {LControl Down}{c}{LControl Up}
		sleep 100
		WinActivate, WP Import Master - Zebra - Excel ahk_exe EXCEL.EXE
		sleep 100
		send, {f2}
		sleep 200
		Send, {LControl Down}{v}{LControl Up}
		sleep 100
		send, {enter}
		sleep 100
		Send, {right 17}
		sleep 100
		Send, {up}
		
		THERE ARE AN ADDITIONAL 15 SECTIONS REPRESENTING A NEW COLUMN IN THE EXCEL, not going to include them all but they all are based on the code above.
		====================================================================================
		;Following ToolTip

	;[Controller Part]
		FollowingTooltip:
		mousegetpos, x, y
		tooltip, %Text%, (x + 20), (y + 20), 1
		If (A_TickCount < End)
			Return
		SetTimer,, Off
		ToolTip
		Return	

 	;[Action Part] - Place this anywhere to get a following tooltip
		Text = Model
		End := A_TickCount + 10000
		SetTimer, FollowingTooltip, 50
		
		======================================================================
		;resets modifiers
		
		#InstallKeybdHook
		SetTimer, Modifier_Up, 500
		Modifier_Up:
		For Each, Modifier in ["Shift","Control","LWin","RWin","Alt"]
			If GetKeyState(Modifier) And !GetKeyState(Modifier,"P")
				Send, {%Modifier% Up}
		Return	
		
		

Return to “Ask for Help (v1)”