PHP Code:
#include <Array.au3>
#include <misc.au3>
#include "Key.au3"
$dll= DllOpen("user32.dll")
_SetupKeysGen(5, "file.ini")
_KeyGen()
_Check()
Func _Check()
HotKeySet("{Ä}", "_Pause")
While 1
If _IsPressed(57, $dll) Then
$t = TimerInit()
While _IsPressed(57, $dll)
Sleep(10)
WEnd
$td = TimerDiff($t)
;MsgBox(64, "Taste wurde gedrückt", "Die Taste W, wurde "&$td& "MS gedrückt!")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{W down}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep("&$td&")")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{W up}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep(100)")
ElseIf _IsPressed(41, $dll) Then
$t = TimerInit()
While _IsPressed(41, $dll)
Sleep(10)
WEnd
$td = TimerDiff($t)
;MsgBox(64, "Taste wurde gedrückt", "Die Taste A, wurde "&$td& "MS gedrückt!")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{A down}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep("&$td&")")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{A up}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep(100)")
ElseIf _IsPressed(44, $dll) Then
$t = TimerInit()
While _IsPressed(44, $dll)
Sleep(10)
WEnd
$td = TimerDiff($t)
;MsgBox(64, "Taste wurde gedrückt", "Die Taste D, wurde "&$td& "MS gedrückt!")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{D down}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep("&$td&")")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{D up}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep(100)")
ElseIf _IsPressed(53, $dll) Then
$t = TimerInit()
While _IsPressed(53, $dll)
Sleep(10)
WEnd
$td = TimerDiff($t)
;MsgBox(64, "Taste wurde gedrückt", "Die Taste S, wurde "&$td& "MS gedrückt!")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{S down}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep("&$td&")")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "ControlSend($W, "", "", '{S up}')")
IniWriteSection(@ScriptDir & "\bla.txt", "Keys", "Sleep(100)")
EndIf
WEnd
EndFunc
Func _Pause()
$UnPaused = NOT $UnPaused
While $UnPaused
Sleep(10)
WEnd
EndFunc