DEV Community

Query Filter
Query Filter

Posted on

key4

#SingleInstance Force
#IfWinActive, Project Structure

moveCount := 0
active := true

; Initial tooltip
ToolTip, Move counter ACTIVE`nMoves: 0, 20, 20

Up::
    if (!active)
        return

    ; prevent key auto-repeat overcount
    if (A_PriorHotkey = "Up" && A_TimeSincePriorHotkey < 120)
        return

    moveCount++
    ToolTip, Move counter ACTIVE`nMoves: %moveCount%, 20, 20

    Send, {Up}
return

Down::
    if (!active)
        return

    if (A_PriorHotkey = "Down" && A_TimeSincePriorHotkey < 120)
        return

    moveCount--
    ToolTip, Move counter ACTIVE`nMoves: %moveCount%, 20, 20

    Send, {Down}
return

Esc::
    active := false
    ToolTip
return

#IfWinActive

Enter fullscreen mode Exit fullscreen mode

Top comments (0)