Hier ist mein Keybinder, er besteht aus For Schleifen um Platz zu sparen.
Ihr könnt gerne Verbesserungsvorschläge äußern.
Spoiler anzeigen
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Misc.au3>
Global $Form[250], $MenuItem[250], $Label[250], $Input[250], $R_F[250]
Dim $Timer
#Region ### START Koda GUI section ### Form=
$Form[0] = GUICreate("Simple Keybinder", 328, 380, 193, 132)
$MenuItem[0] = GUICtrlCreateMenu("Datei")
$MenuItem[1] = GUICtrlCreateMenu("About")
$MenuItem[2] = GUICtrlCreateMenuItem("Laden", $MenuItem[0])
$MenuItem[3] = GUICtrlCreateMenuItem("Speichern", $MenuItem[0])
$MenuItem[4] = GUICtrlCreateMenuItem("Leeren", $MenuItem[0])
$MenuItem[5] = GUICtrlCreateMenuItem("Coder", $MenuItem[1])
$Label[0] = GUICtrlCreateLabel("F1", 8, 8, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[1] = GUICtrlCreateLabel("F2", 8, 40, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[2] = GUICtrlCreateLabel("F3", 8, 72, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[3] = GUICtrlCreateLabel("F4", 8, 104, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[4] = GUICtrlCreateLabel("F5", 8, 136, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[5] = GUICtrlCreateLabel("F6", 8, 168, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[6] = GUICtrlCreateLabel("F7", 8, 200, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[7] = GUICtrlCreateLabel("F8", 8, 232, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[8] = GUICtrlCreateLabel("F9", 8, 264, 34, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[9] = GUICtrlCreateLabel("F10", 8, 296, 44, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Label[10] = GUICtrlCreateLabel("F11", 8, 328, 44, 28)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
$Input[0] = GUICtrlCreateInput("", 40, 8, 265, 21)
$Input[1] = GUICtrlCreateInput("", 40, 40, 265, 21)
$Input[2] = GUICtrlCreateInput("", 40, 72, 265, 21)
$Input[3] = GUICtrlCreateInput("", 40, 104, 265, 21)
$Input[4] = GUICtrlCreateInput("", 40, 136, 265, 21)
$Input[5] = GUICtrlCreateInput("", 40, 168, 265, 21)
$Input[6] = GUICtrlCreateInput("", 40, 200, 265, 21)
$Input[7] = GUICtrlCreateInput("", 40, 232, 265, 21)
$Input[8] = GUICtrlCreateInput("", 40, 264, 265, 21)
$Input[9] = GUICtrlCreateInput("", 56, 296, 265, 21)
$Input[10] = GUICtrlCreateInput("", 56, 328, 265, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$dll = DllOpen("user32.dll")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $MenuItem[2]
For $i = 0 to 10 Step +1
$R_F[$i] = IniRead(@ScriptDir & "\save.ini", "Text", "F[" & $i & "]", "NichtGefunden")
GUICtrlSetData($Input[$i], $R_F[$i])
Next
MsgBox(64, "Erfolgreich geladet!", "Sie haben erfoglreich geladet.")
Case $MenuItem[3]
For $i = 0 to 10 Step +1
$R_F[$i] = GUICtrlRead($Input[$i])
Next
_FileCreate(@ScriptDir & "\save.ini")
For $i = 0 to 10 Step +1
IniWrite(@ScriptDir & "\save.ini", "Text", "F[" & $i & "]", $R_F[$i])
Next
MsgBox(64, "Erfolgreich Gespeichert!", "Sie haben erfolgreich gespeichert.")
Case $MenuItem[4]
For $i = 0 to 10 Step +1
GUICtrlSetData($Input[$i], "")
Next
Case $MenuItem[5]
MsgBox(64, "Coder", "Der Coder dieses Keybinder´s ist: Sezer Kabak.")
EndSwitch
[/autoit] [autoit][/autoit] [autoit]TastenDrucks()
Timer()
WEnd
Func Timer()
If $Timer = true Then
Sleep(250)
$Timer = false
EndIf
EndFunc
Func TastenDrucks()
Timer()
If _IsPressed("70", $dll) Then ;F1
$Read70 = GUICtrlRead($Input[0])
Sleep(150)
Send($Read70)
$Timer = true
ElseIf _IsPressed("71", $dll) Then ;F2
$Read71 = GUICtrlRead($Input[1])
Sleep(150)
Send($Read71)
$Timer = true
ElseIf _IsPressed("72", $dll) Then ;F3
$Read72 = GUICtrlRead($Input[2])
Sleep(150)
Send($Read72)
$Timer = true
ElseIf _IsPressed("73", $dll) Then ;F4
$Read73 = GUICtrlRead($Input[3])
Sleep(150)
Send($Read73)
$Timer = true
ElseIf _IsPressed("74", $dll) Then ;F5
$Read74 = GUICtrlRead($Input[4])
Sleep(150)
Send($Read74)
$Timer = true
ElseIf _IsPressed("75", $dll) Then ;F6
$Read75 = GUICtrlRead($Input[5])
Sleep(150)
Send($Read75)
$Timer = true
ElseIf _IsPressed("76", $dll) Then ;F7
$Read76 = GUICtrlRead($Input[6])
Sleep(150)
Send($Read76)
$Timer = true
ElseIf _IsPressed("77", $dll) Then ;F8
$Read77 = GUICtrlRead($Input[7])
Sleep(150)
Send($Read77)
$Timer = true
ElseIf _IsPressed("78", $dll) Then ;F9
$Read78 = GUICtrlRead($Input[8])
Sleep(150)
Send($Read78)
$Timer = true
ElseIf _IsPressed("79", $dll) Then ;F10
$Read79 = GUICtrlRead($Input[9])
Sleep(150)
Send($Read79)
$Timer = true
ElseIf _IsPressed("7A", $dll) Then ;F11
$Read7a = GUICtrlRead($Input[10])
Sleep(150)
Send($Read7a)
$Timer = true
EndIf
EndFunc