• Hier ist mein Keybinder, er besteht aus For Schleifen um Platz zu sparen.
    Ihr könnt gerne Verbesserungsvorschläge äußern.

    Spoiler anzeigen
    [autoit]

    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <File.au3>
    #include <Misc.au3>

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

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

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

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

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

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

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    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.")

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

    Case $MenuItem[3]
    For $i = 0 to 10 Step +1
    $R_F[$i] = GUICtrlRead($Input[$i])
    Next

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

    _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.")

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

    Case $MenuItem[4]
    For $i = 0 to 10 Step +1
    GUICtrlSetData($Input[$i], "")
    Next

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

    Case $MenuItem[5]
    MsgBox(64, "Coder", "Der Coder dieses Keybinder´s ist: Sezer Kabak.")

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

    EndSwitch

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

    TastenDrucks()
    Timer()
    WEnd

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

    Func Timer()
    If $Timer = true Then
    Sleep(250)
    $Timer = false
    EndIf
    EndFunc

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

    Func TastenDrucks()
    Timer()
    If _IsPressed("70", $dll) Then ;F1
    $Read70 = GUICtrlRead($Input[0])
    Sleep(150)

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

    Send($Read70)
    $Timer = true
    ElseIf _IsPressed("71", $dll) Then ;F2
    $Read71 = GUICtrlRead($Input[1])
    Sleep(150)

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

    Send($Read71)
    $Timer = true
    ElseIf _IsPressed("72", $dll) Then ;F3
    $Read72 = GUICtrlRead($Input[2])
    Sleep(150)

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

    Send($Read72)
    $Timer = true
    ElseIf _IsPressed("73", $dll) Then ;F4
    $Read73 = GUICtrlRead($Input[3])
    Sleep(150)

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

    Send($Read73)
    $Timer = true
    ElseIf _IsPressed("74", $dll) Then ;F5
    $Read74 = GUICtrlRead($Input[4])
    Sleep(150)

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

    Send($Read74)
    $Timer = true
    ElseIf _IsPressed("75", $dll) Then ;F6
    $Read75 = GUICtrlRead($Input[5])
    Sleep(150)

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

    Send($Read75)
    $Timer = true
    ElseIf _IsPressed("76", $dll) Then ;F7
    $Read76 = GUICtrlRead($Input[6])
    Sleep(150)

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

    Send($Read76)
    $Timer = true
    ElseIf _IsPressed("77", $dll) Then ;F8
    $Read77 = GUICtrlRead($Input[7])
    Sleep(150)

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

    Send($Read77)
    $Timer = true
    ElseIf _IsPressed("78", $dll) Then ;F9
    $Read78 = GUICtrlRead($Input[8])
    Sleep(150)

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

    Send($Read78)
    $Timer = true
    ElseIf _IsPressed("79", $dll) Then ;F10
    $Read79 = GUICtrlRead($Input[9])
    Sleep(150)

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

    Send($Read79)
    $Timer = true
    ElseIf _IsPressed("7A", $dll) Then ;F11
    $Read7a = GUICtrlRead($Input[10])
    Sleep(150)

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

    Send($Read7a)
    $Timer = true
    EndIf
    EndFunc

    [/autoit]
  • Mal als Verbesserungsvorschläge/Tipps an dich ;)

    1. Schau dir mal chessi's Tutorial an, was z.B. Variablen-Präfixe angeht.

    2.

    [...] um Platz zu sparen.

    Wieso nutzt du dann Arrays nicht zu ihrem vollem Potenzial aus?
    Den Code kann man auf sicher noch ordentlich kürzen. Z.b. die Zeilen 19 bis 52 kannst du durch diese 6 hier ersetzen (man kann hier sogar noch eine Zeile sparen, $iWidth):

    [autoit]

    For $i = 0 To 10
    Local $iWidth = ($i ? ($i * 32) : 8)
    $Label[$i] = GUICtrlCreateLabel("F" & String($i+1), 8, $iWidth, (($i < 9) ? 34 : 44), 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Input[$i] = GUICtrlCreateInput("", 40, $iWidth, 265, 21)
    Next

    [/autoit]

    :D

    3. Dim sollte man nicht benutzen, sondern Global/Local.

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • Ein nettes kleines Tool. 2 Verbesserungsvorschläge:

    1. MsgBox(64, "Erfolgreich geladet!", "Sie haben erfoglreich geladet.")
    MsgBox(64, "Erfolgreich geladen!", "Sie haben erfoglreich geladen.")
    Manche legen auf Sprache Wert ;D

    2. Es könnte schnell passieren, dass jemand die Taste etwas länger gedrückt hält. Du hast ja versucht, dass mit dem Timer zu beheben (250ms)
    Ich denke, es wäre sicherer, das mittels Hooks zu lösen.

    Du könntes dann jeweils bei der Passenden UP-Meldung deine Funktion aufrufen.
    Ich hab mal ein kleines Beispiel-Script gebastelt:

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <StructureConstants.au3>
    #include <MsgBoxConstants.au3>
    #include <array.au3>

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

    Global Const $MOUSE_MOVE_EVENT = 0x200 ;512 (WM_MOUSEMOVE) ; ==> Mouse moving.
    Global Const $MOUSE_PRIMARYDOWN_EVENT = 0x201 ;513 (WM_LBUTTONDOWN) ; ==> Primary mouse button down.
    Global Const $MOUSE_PRIMARYUP_EVENT = 0x202 ;514 (WM_LBUTTONUP) ; ==> Primary mouse button up.
    Global Const $MOUSE_PRIMARYDBLCLK_EVENT = 0x203 ;515 (WM_LBUTTONDBLCLK) ; ==> Primary mouse button double click.
    Global Const $MOUSE_SECONDARYDOWN_EVENT = 0x204 ;516 (WM_RBUTTONDOWN) ; ==> Secondary mouse button down.
    Global Const $MOUSE_SECONDARYUP_EVENT = 0x205 ;517 (WM_RBUTTONUP) ; ==> Secondary mouse button up.
    Global Const $MOUSE_SECONDARYDBLCLK_EVENT = 0x206 ;518 (WM_RBUTTONDBLCLK) ; ==> Secondary mouse button double click.
    Global Const $MOUSE_WHEELDOWN_EVENT = 0x207 ;519 (WM_MBUTTONDOWN) ; ==> Wheel mouse button pressed down.
    Global Const $MOUSE_WHEELUP_EVENT = 0x208 ;520 (WM_MBUTTONUP) ; ==> Wheel mouse button up.
    Global Const $MOUSE_WHEELDBLCLK_EVENT = 0x209 ;521 (WM_MBUTTONDBLCLK) ; ==> Wheel mouse button double click.
    Global Const $MOUSE_WHEELSCROLL_EVENT = 0x20A ;522 (WM_MOUSEWHEEL) ; ==> Wheel mouse scroll.
    Global Const $MOUSE_WHEELSCROLLDOWN_EVENT = 0x20A + 8 ;530 (WM_MOUSEWHEEL + 8) ; ==> Wheel mouse scroll Down.
    Global Const $MOUSE_WHEELSCROLLUP_EVENT = 0x20A + 16 ;538 (WM_MOUSEWHEEL + 16) ; ==> Wheel mouse scroll Up.
    Global Const $MOUSE_XBUTTONDOWN_EVENT = 0x20B ;523 (WM_XBUTTONDOWN) ; ==> Side mouse button down (usually navigating next/back buttons).
    Global Const $MOUSE_XBUTTONUP_EVENT = 0x20C ;524 (WM_XBUTTONUP) ; ==> Side mouse button up.
    Global Const $MOUSE_XBUTTONDBLCLK_EVENT = 0x20D ;525 (WM_XBUTTONDBLCLK) ; ==> Side mouse button double click.
    global $KeyCodes[205][2]=[[0,"0"] _
    ,[1,"1"] _
    ,[2,"2"] _
    ,[3,"3"] _
    ,[4,"4"] _
    ,[5,"5"] _
    ,[6,"6"] _
    ,[7,"7"] _
    ,[8,"[DELETE]"] _
    ,[9,"[TAB]"] _
    ,[10,""] _
    ,[11,""] _
    ,[12,""] _
    ,[13,"[ENTER]"] _
    ,[14,""] _
    ,[15,""] _
    ,[16,""] _
    ,[17,""] _
    ,[18,""] _
    ,[19,"[PAUSE]"] _
    ,[20,"[CAPSLOG]"] _
    ,[21,""] _
    ,[22,""] _
    ,[23,""] _
    ,[24,""] _
    ,[25,""] _
    ,[26,""] _
    ,[27,"[ESC]"] _
    ,[28,""] _
    ,[29,""] _
    ,[30,""] _
    ,[31,""] _
    ,[32,"[LEERTASTE]"] _
    ,[33,"[BILDHOCH]"] _
    ,[34,"[BILDRUNTER]"] _
    ,[35,"[ENDE]"] _
    ,[36,"[POS1]"] _
    ,[37,"[PFEILLINKS]"] _
    ,[38,"[PFEILHOCH]"] _
    ,[39,"[PFEILRECHTS]"] _
    ,[40,"[PFEILRUNTER]"] _
    ,[41,""] _
    ,[42,""] _
    ,[43,""] _
    ,[44,"[DRUCK]"] _
    ,[45,"[EINFÜGEN]"] _
    ,[46,"[ENTFERNEN]"] _
    ,[47,""] _
    ,[48,"0"] _
    ,[49,"1"] _
    ,[50,"2"] _
    ,[51,"3"] _
    ,[52,"4"] _
    ,[53,"5"] _
    ,[54,"6"] _
    ,[55,"7"] _
    ,[56,"8"] _
    ,[57,"9"] _
    ,[58,""] _
    ,[59,""] _
    ,[60,""] _
    ,[61,""] _
    ,[62,""] _
    ,[63,""] _
    ,[64,""] _
    ,[65,"a"] _
    ,[66,"b"] _
    ,[67,"c"] _
    ,[68,"d"] _
    ,[69,"e"] _
    ,[70,"f"] _
    ,[71,"g"] _
    ,[72,"h"] _
    ,[73,"i"] _
    ,[74,"j"] _
    ,[75,"k"] _
    ,[76,"l"] _
    ,[77,"m"] _
    ,[78,"n"] _
    ,[79,"o"] _
    ,[80,"p"] _
    ,[81,"q"] _
    ,[82,"r"] _
    ,[83,"s"] _
    ,[84,"t"] _
    ,[85,"u"] _
    ,[86,"v"] _
    ,[87,"w"] _
    ,[88,"x"] _
    ,[89,"y"] _
    ,[90,"z"] _
    ,[91,"[WINDOWS]"] _
    ,[92,""] _
    ,[93,"[LISTE]"] _
    ,[94,""] _
    ,[95,""] _
    ,[96,"[Block 0]"] _
    ,[97,"[Block 1]"] _
    ,[98,"[Block 2]"] _
    ,[99,"[Block 3]"] _
    ,[100,"[Block 4]"] _
    ,[101,"[Block 5]"] _
    ,[102,"[Block 6]"] _
    ,[103,"[Block 7]"] _
    ,[104,"[Block 8]"] _
    ,[105,"[Block 9]"] _
    ,[106,"[Block *]"] _
    ,[107,"[Block +]"] _
    ,[108,""] _
    ,[109,"[Block -]"] _
    ,[110,"[Block ,]"] _
    ,[111,"[Block /]"] _
    ,[112,"[F1]"] _
    ,[113,"[F2]"] _
    ,[114,"[F3]"] _
    ,[115,"[F4]"] _
    ,[116,"[F5]"] _
    ,[117,"[F6]"] _
    ,[118,"[F7]"] _
    ,[119,"[F8]"] _
    ,[120,"[F9]"] _
    ,[121,"[F10]"] _
    ,[122,"[F11]"] _
    ,[123,"[F12]"] _
    ,[124,""] _
    ,[125,""] _
    ,[126,""] _
    ,[127,""] _
    ,[128,""] _
    ,[129,""] _
    ,[130,""] _
    ,[131,""] _
    ,[132,""] _
    ,[133,""] _
    ,[134,""] _
    ,[135,""] _
    ,[136,""] _
    ,[137,""] _
    ,[138,""] _
    ,[139,""] _
    ,[140,""] _
    ,[141,""] _
    ,[142,""] _
    ,[143,""] _
    ,[144,"[NUM]"] _
    ,[145,"[ROLLEN]"] _
    ,[146,""] _
    ,[147,""] _
    ,[148,""] _
    ,[149,""] _
    ,[150,""] _
    ,[151,""] _
    ,[152,""] _
    ,[153,""] _
    ,[154,""] _
    ,[155,""] _
    ,[156,""] _
    ,[157,""] _
    ,[158,""] _
    ,[159,""] _
    ,[160,"[SHIFTLINKS]"] _
    ,[161,"[SHIFTRECHTS]"] _
    ,[162,"[STRG]"] _
    ,[163,""] _
    ,[164,"[ALT]"] _
    ,[165,"[ALT GR]"] _
    ,[166,""] _
    ,[167,""] _
    ,[168,""] _
    ,[169,""] _
    ,[170,""] _
    ,[171,""] _
    ,[172,""] _
    ,[173,""] _
    ,[174,""] _
    ,[175,""] _
    ,[176,""] _
    ,[177,""] _
    ,[178,""] _
    ,[179,""] _
    ,[180,""] _
    ,[181,""] _
    ,[182,""] _
    ,[183,""] _
    ,[184,""] _
    ,[185,""] _
    ,[186,"ü"] _
    ,[187,"+"] _
    ,[188,","] _
    ,[189,"-"] _
    ,[190,"."] _
    ,[191,"#"] _
    ,[192,"ö"] _
    ,[193,""] _
    ,[194,""] _
    ,[195,""] _
    ,[196,""] _
    ,[197,""] _
    ,[198,""] _
    ,[199,""] _
    ,[220,"^"] _
    ,[219,"ß"] _
    ,[221,"´"] _
    ,[222,"ä"] _
    ,[226,"<"] _
    ]

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

    $hmod = _WinAPI_GetModuleHandle(0)
    $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
    $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
    $hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
    $hMouseHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_MouseProc), $hmod)

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

    While sleep(100)
    WEnd

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

    Func _KeyProc($nCode, $wParam, $lParam)
    Local $tKEYHOOKS
    $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    If $nCode < 0 Then
    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    EndIf
    If $wParam = $WM_KEYDOWN Then
    $r=DllStructGetData($tKEYHOOKS, "vkCode")
    Local $flags = DllStructGetData($tKEYHOOKS, "flags")
    Switch $flags
    Case $LLKHF_ALTDOWN
    ConsoleWrite("[Alt]"&@crlf)
    EndSwitch
    keyDown($r)
    endif
    If $wParam = $WM_KEYUP Then
    $r=DllStructGetData($tKEYHOOKS, "vkCode")
    Local $flags = DllStructGetData($tKEYHOOKS, "flags")
    Switch $flags
    Case $LLKHF_ALTDOWN
    ConsoleWrite("([Alt] UP)"&@crlf)
    EndSwitch
    keyUP($r)
    endif
    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    EndFunc ;==>_KeyProc

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

    Func _MouseProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then
    Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam) ;Continue processing
    EndIf
    Local $iEvent = _WinAPI_LoWord($wParam)
    Local $iRet
    Local $iBlockDefProc_Ret
    Local $iWScrollDirection = 0
    Switch $iEvent
    Case $MOUSE_PRIMARYDOWN_EVENT
    ConsoleWrite("Linke Maustaste gedrückt"&@crlf)
    Case $MOUSE_PRIMARYUP_EVENT
    ConsoleWrite("Linke Maustaste losgelassen"&@crlf)
    Case $MOUSE_PRIMARYDBLCLK_EVENT
    ConsoleWrite("Linke Maustaste doppelklick"&@crlf)
    Case $MOUSE_SECONDARYDOWN_EVENT
    ConsoleWrite("Rechte Maustaste gedrückt"&@crlf)
    Case $MOUSE_SECONDARYUP_EVENT
    ConsoleWrite("Rechte Maustaste losgelassen"&@crlf)
    Case $MOUSE_SECONDARYDBLCLK_EVENT
    ConsoleWrite("Rechte Maustaste doppelklick"&@crlf)
    Case $MOUSE_WHEELDOWN_EVENT
    ConsoleWrite("Mausrad gedrückt"&@crlf)
    Case $MOUSE_WHEELUP_EVENT
    ConsoleWrite("Mausrad losgelassen"&@crlf)
    Case $MOUSE_WHEELSCROLLDOWN_EVENT
    ConsoleWrite("Mausrad nach unten gedreht"&@crlf)
    Case $MOUSE_WHEELSCROLLUP_EVENT
    ConsoleWrite("Mausrad nach oben gedreht"&@crlf)
    Case $MOUSE_XBUTTONDOWN_EVENT
    ConsoleWrite("Andere Maustaste gedrückt"&@crlf)
    Case $MOUSE_XBUTTONUP_EVENT
    ConsoleWrite("Andere Maustaste losgelassen"&@crlf)
    Case $MOUSE_XBUTTONDBLCLK_EVENT
    ConsoleWrite("Andere Maustaste doppelklick"&@crlf)
    EndSwitch
    Return _WinAPI_CallNextHookEx($hMouseHook, $nCode, $wParam, $lParam) ;Continue processing
    EndFunc ;==>_KeyProc

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

    Func keyDown($keycode)
    $x=_ArraySearch($KeyCodes,$keycode,0,0,0,0,1,0)
    if $x=-1 then
    ConsoleWrite("(KEY:"&$keycode&")"&@crlf)
    else
    if $KeyCodes[$x][1]="" then
    ConsoleWrite("(KEY:"&$x&")"&@crlf)
    else
    ConsoleWrite($KeyCodes[$x][1]&@crlf)
    endif
    endif
    EndFunc

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

    Func keyUp($keycode)
    $x=_ArraySearch($KeyCodes,$keycode,0,0,0,0,1,0)
    if $x=-1 then
    ConsoleWrite("(KEY UP:"&$keycode&")"&@crlf)
    else
    if $KeyCodes[$x][1]="" then
    ConsoleWrite("(KEY UP:"&$x&")"&@crlf)
    else
    ConsoleWrite("("&$KeyCodes[$x][1]&" UP)"&@crlf)
    endif
    endif
    EndFunc

    [/autoit]

    Du kannst das Script ja eventuell bei dir mit einbauen :)

    Viel Spaß :)

  • Hi,
    um 62 Zeilen gekürzt...

    Spoiler anzeigen
    [autoit]

    Func TastenDrucks()
    Timer()
    for $i=0x70 to 0x7A
    If _IsPressed(hex($i,2), $dll) Then ;F1-F11
    $Read = GUICtrlRead($Input[$i-112])
    Sleep(150)
    Send($Read)
    $Timer = true
    endif
    next
    ;~ ElseIf _IsPressed("71", $dll) Then ;F2
    ;~ $Read71 = GUICtrlRead($Input[1])
    ;~ Sleep(150)

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

    ;~ Send($Read71)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("72", $dll) Then ;F3
    ;~ $Read72 = GUICtrlRead($Input[2])
    ;~ Sleep(150)

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

    ;~ Send($Read72)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("73", $dll) Then ;F4
    ;~ $Read73 = GUICtrlRead($Input[3])
    ;~ Sleep(150)

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

    ;~ Send($Read73)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("74", $dll) Then ;F5
    ;~ $Read74 = GUICtrlRead($Input[4])
    ;~ Sleep(150)

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

    ;~ Send($Read74)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("75", $dll) Then ;F6
    ;~ $Read75 = GUICtrlRead($Input[5])
    ;~ Sleep(150)

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

    ;~ Send($Read75)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("76", $dll) Then ;F7
    ;~ $Read76 = GUICtrlRead($Input[6])
    ;~ Sleep(150)

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

    ;~ Send($Read76)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("77", $dll) Then ;F8
    ;~ $Read77 = GUICtrlRead($Input[7])
    ;~ Sleep(150)

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

    ;~ Send($Read77)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("78", $dll) Then ;F9
    ;~ $Read78 = GUICtrlRead($Input[8])
    ;~ Sleep(150)

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

    ;~ Send($Read78)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("79", $dll) Then ;F10
    ;~ $Read79 = GUICtrlRead($Input[9])
    ;~ Sleep(150)

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

    ;~ Send($Read79)
    ;~ $Timer = true
    ;~ ElseIf _IsPressed("7A", $dll) Then ;F11
    ;~ $Read7a = GUICtrlRead($Input[10])
    ;~ Sleep(150)

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

    ;~ Send($Read7a)
    ;~ $Timer = true
    ;~ EndIf
    EndFunc

    [/autoit]


    Wer jetzt noch nicht weiß, wie man den Code einer gedrückten Taste von AutoIt erhält... 8o