Skip to content

Instantly share code, notes, and snippets.

@soonix
Last active February 25, 2021 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soonix/76cce0f33aa0e5cf2944a27a9350da5c to your computer and use it in GitHub Desktop.
Save soonix/76cce0f33aa0e5cf2944a27a9350da5c to your computer and use it in GitHub Desktop.
Tastenzähler Autohotkey
#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.
Tasten := "asdf"
filePath = C:\Users\Jeremias\Documents\zaehler.txt
FileReadLine, Zaehler, %filePath%, 1
Loop, Parse, Tasten
{
Hotkey, ~*%A_LoopField% up, CountKeys, On
}
return
CountKeys:
{
Zaehler++
FileDelete, %filePath%
FileAppend, %Zaehler%, %filePath%
}
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment