Brauche Hilfe bei Keybinder

  • Quick and dirty mit arrays:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <ComboConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    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"

    [/autoit] [autoit][/autoit] [autoit]

    $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)

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit]
  • Naja, das mit den Arrays ist mir zu kompliziert und ich verstehe das nicht, kann man denn Fehler auch anders beheben?