#SingleInstance, force #Persistent SetTitleMatchMode, 2 ; "contain string" ; @dx, number , Move cursor horizontally ; @dy, boolean, Move cursor vertically Quickbar(dx := "", dy := "") { local static col := 1 static row := "upper" if (dx) { col := Mod(col + dx + 10, 10) } if (dy) { row := (row == "upper") ? "lower" : "upper" } if (row == "lower") { Send, % "x" col "x" } else { Send, % col } } #IfWinActive ahk_exe factorio.exe ; Map Quickbar to arrow keys. Left:: Quickbar( -1) ; go one slot left Right::Quickbar( 1) ; go one slot right Up:: Quickbar(,true) ; change row Down:: Send, % "q" ; clear cursor ; Auto-reload for debugging. #IfWinActive factorio_dpad_quickbar.ahk ~^s::reload