Quick and dirty mit arrays:
Spoiler anzeigen
#include <GUIConstants.au3>
#include <ComboConstants.au3>
Dim $Input[10], $Combo[10], $CheckboxAktiv[10], $CheckboxEnter[10]
$combotext = "1|2|3|4|5|6|7|8|9|0|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|NUMPAD1|NUMPAD2|NUMPAD3|NUMPAD4|NUMPAD5|NUMPAD6|NUMPAD7|NUMPAD8|NUMPAD9|NUMPAD0"
$Form1 = GUICreate("SA:MP Keybinder by cOraXx", 700, 250)
Dim $Input[10], $Combo[10], $CheckboxAktiv[10], $CheckboxEnter[10]
For $i = 0 To 9
$Input[$i] = GUICtrlCreateInput("", 8, 8 + $i*24, 417, 21)
$Combo[$i] = GUICtrlCreateCombo("", 432, 8 + $i*24, 89, 25, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, $combotext)
$CheckboxAktiv[$i] = GUICtrlCreateCheckbox("Aktivieren", 528, 8 + $i*24, 65, 25)
$CheckboxEnter[$i] = GUICtrlCreateCheckbox("ENTER", 600, 8 + $i*24, 65, 25)
Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $CheckboxAktiv[0] To $CheckboxAktiv[9]
$ID = 0
While $nMsg <> $CheckboxAktiv[$ID]
$ID += 1
WEnd
If GUICtrlRead($nMsg) = $GUI_CHECKED Then
HotKeySet(GUICtrlRead($Combo[$ID]), "_Keybind")
GUICtrlSetState($Combo[$ID], $GUI_DISABLE)
GUICtrlSetState($Input[$ID], $GUI_DISABLE)
Else
HotKeySet(GUICtrlRead($nMsg-1))
GUICtrlSetState($Combo[$ID], $GUI_ENABLE)
GUICtrlSetState($Input[$ID], $GUI_ENABLE)
EndIf
EndSwitch
WEnd
Func _Keybind()
For $i = 0 To 9
If @HotKeyPressed = GUICtrlRead($Combo[$i]) Then
HotKeySet(GUICtrlRead($Combo[$i]))
Send(GUICtrlRead($Input[$i]),1)
If GUICtrlRead($CheckboxEnter[$i]) = $GUI_CHECKED Then Send("{ENTER}")
HotKeySet(GUICtrlRead($Combo[$i]), "_Keybind")
EndIf
Next
EndFunc