Jump to content

help needed for autohotkey for workflow

Go to solution Solved by minibois,

This should work for that:

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)

Morning guys, 

I've been meaning to try and implement hotkeys for my work. I'm working in warehouse inventory and I'm looking at options to reduce the amount of movements needed to do task while logging in the work. What I have in my mind is the following.

 

hotkey ctrl + Numpad 1 = (key press backspace, arrow key up, enter, F8)

 

 

Due to lack of time I cant sit down to give it a try on my own and which is why I'm asking for help here. thanks for those willing to give this a go.

if I'm missing any info needed let me know I'll try my best to reply on a short notice

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

This should work for that:

 

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

On ‎3‎/‎11‎/‎2019 at 12:30 PM, Minibois said:

This should work for that:

 


#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


;Lines that start with a semicolon (;) are comments and only there to clarify statements.
;^ means Ctrl and I think Numpad1 and all other keycodes are pretty obvious. 
;You might need to adjust the sleep according to your use/program/PC
^Numpad1::
	SendInput, {Backspace}
	Sleep, 50
	SendInput, {Up}
	Sleep, 50
	SendInput, {Enter}
	Sleep, 50
	SendInput, {F8}
Return

I have generally found sleep for 50 to be quite good, but you might need to adjust that after testing.

 

 

(Also, this code is assuming you want to press one key after another, not have the program press them all at once)

This worked amazingly well, thank you, Tho would it be possible to add one extra step at the end for another input, a combined press of Ctrl Shift and F8 (Ctrl+Shift+F8) or would AHK not be able to do it?

Link to comment
Share on other sites

Link to post
Share on other sites

42 minutes ago, Drummerforlife said:

This worked amazingly well, thank you, Tho would it be possible to add one extra step at the end for another input, a combined press of Ctrl Shift and F8 (Ctrl+Shift+F8) or would AHK not be able to do it?

AHK is certainly able to do that :) 

Just add this where you need it:

; This command first pressed Ctrl down, then Shift down and only then presses F8 to ensure F8 is pressed while the others are down.
SendInput, {Ctrl down}{Shift down}{F8}{Ctrl up}{Shift up}

 

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×