Increase/Decrease selected quantity program

Post your working scripts, libraries and tools for AHK v1.1 and older
iroebuck
Posts: 2
Joined: 21 Aug 2019, 11:59

Increase/Decrease selected quantity program

04 Sep 2019, 16:53

A pet project of mine for quite a while now has been to use AHK to make use of the side wheel on my MX Master.
Since a lot of my job consists of just changing a couple numbers I thought it would be nice to be able to just scroll to change the highlighted quantities quickly and not have to take my hand off the mouse to use the keypad.

When I was just getting into AHK I wrote this little script and it actually did work, though I didn't know anything about variables at the time. I wanna take another crack at this but I was wondering about some tips to do it more efficiently, aside from the obvious of course.
If I remember, It wasn't super reliable, there was often lag, and it still wanted to keep using the horizontal scroll function so I would get windows scrolling all over the place.
I would like to get it to just replace the highlighted text directly instead of just typing it out, but I only know how to address a specific edit control, not just whatever one contains the highlighted text.

Any useful ideas would be greatly appreciated.

Code: Select all

#MaxHotkeysPerInterval 1000

wheelright::
ClipSaved1 := Clipboard
sleep, 100
clipboard := 
send, ^c
clipboard ++
send, ^v
x := Strlen(clipboard)
sendinput, {shift down}
send, {left %x%}
sendinput, {shift up}
clipboard := 
sleep, 100
Clipboard := ClipSaved1 
return


wheelleft::
ClipSaved2 := Clipboard
sleep, 100
clipboard := 
send, ^c
clipboard --
send, ^v
x := Strlen(clipboard)
sendinput, {shift down}
send, {left %x%}
sendinput, {shift up}
clipboard := 
sleep, 100
Clipboard := ClipSaved2 
return

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: vysmaty and 231 guests