_IsPressed Problem

  • Ich möchte gern eine msgbox auftauchen lassen, wenn man rechtsklick + F5 macht.

    Weiss jmt. wie ich das mit dem And lösen kann, so dass es geht?

    [autoit]

    #include <misc.au3>

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

    $i = 0

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

    While $i = 0
    If _IsPressed (02 And 74) Then
    MsgBox (0,"title","lol")
    Else
    sleep (100)
    EndIf
    WEnd

    [/autoit]

    Wie kann ich jetzt noch weitere "hotkeys" einfügen?

    Danke zum voraus.

  • Ich habs selbst gelöst^^

    [autoit]

    #include <misc.au3>

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

    $i = 0

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

    While $i = 0
    Select
    Case (_IsPressed (74)) And (_IsPressed (02))
    MsgBox (0,"title","lol5")
    Case (_IsPressed (75)) And (_IsPressed (02))
    MsgBox (0,"title","lol6")
    Case (_IsPressed (76) ) And (_IsPressed (02))
    MsgBox (0,"title","lol7")
    Case (_IsPressed (77)) And (_IsPressed (02))
    MsgBox (0,"title","lol8")
    Case (_IsPressed (78)) And (_IsPressed (02))
    MsgBox (0,"title","lol9")
    Case (_IsPressed (79)) And (_IsPressed (02))
    MsgBox (0,"title","lol10")
    EndSelect
    WEnd

    [/autoit]

    Ich hab trotzdem noch eine frage:

    Wie kann ich z.b. eine while-schleife wieder beenden? (nicht das ganze script!!!)

    Einmal editiert, zuletzt von ManuIt (8. Oktober 2007 um 11:27)

  • in der whileschleife nen exitloop
    kannst ja auch ne variable nutzen, die du irgendwo in ner unterfunktion vielleicht änderst

    [autoit]


    global $endeschleife=0
    while 1
    ;tu was, irgendwann $endeschleife mal auf 1 setzen
    if $endeschleife=1 then exitloop
    wend

    [/autoit]

    mfg

  • wie auch alle anderen schleifen-arten mit

    Code
    ExitLoop

    ;)

    zB:

    [autoit]

    While $i = 0
    Select
    Case (_IsPressed (74)) And (_IsPressed (02))
    MsgBox (0,"title","lol5")
    ExitLoop
    EndSelect
    Wend

    [/autoit]