Code: Select all
; Beer
F1::
Clipboard=
Send, +{Left 5}
Send, ^{Ins}
Send, {Backspace}
Send, 1091{Enter}
Sleep 25
Send, ^v
Send, {Enter}
Return
Beer is tired to the F1 key that executed the above code. This mimics a SAM4s cash register workflow. But what I would like to do is, if they press the BEER key, immediately after, say entering 1500 and pressing the BEER key, I want it to simply increment the quantity without the clerk having to enter the same amount again and then press BEER.
Workflow:
1. Customer comes to counter with a six pack of beer
2. Clerk rings in beer amount, touches 799 on keyboard then presses the BEER key on the Keyboard
3. The above F1 code is executed
4. IF clerk presses BEER key again, repeat the code above with the 799 amount already in Clipboard (to repeat, and increment the quantity to 2)
5. ELSE do not repeat code, no matter if the BEER is key presses immediately one other key is depressed.
IF ELSE is the solution? Or
if F1 (repeats) {
...
}
Clipboard=
Send, +{Left 5}
Send, ^{Ins}
Send, {Backspace}
Send, 1091{Enter}
Sleep 25
Send, ^v
Send, {Enter}}
{
...
} else {
DO NOTHING
...
}
Thank you to anyone that can help. I am getting better at AHK but still need direction at times with my coding.