Tastenkombinationen

  • Also ich möchte gerne ein Programm machen das wenn man eine
    Tastenkombination drückt eine von drei Aktionen ausführen soll.
    Ich weis aber überhaupt nich wie ich das anfangen soll.
    :hm:

  • Hallo!


    Das geht so:


    1) Mit HotKeySet("!a", "_func1")


    Beispiel aus der Hilfe:

    [autoit]

    ; Press Esc to terminate script, Pause/Break to "pause"

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

    Global $Paused
    HotKeySet("{PAUSE}", "TogglePause")
    HotKeySet("{ESC}", "Terminate")
    HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

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

    ;;;; Body of program would go here ;;;;
    While 1
    Sleep(100)
    WEnd
    ;;;;;;;;

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

    Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
    sleep(100)
    ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
    EndFunc

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

    Func Terminate()
    Exit 0
    EndFunc

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

    Func ShowMessage()
    MsgBox(4096,"","This is a message.")
    EndFunc

    [/autoit]

    Hier eine Reihe von "tasten", die du im HotKeySet nehmen kannst:

    {!} !
    {#} #
    {+} +
    {^} ^
    {{} {
    {}} }
    {SPACE} SPACE
    {ENTER} ENTER key on the main keyboard
    {ALT} ALT
    {BACKSPACE} or {BS} BACKSPACE
    {DELETE} or {DEL} DELETE
    {UP} Up arrow
    {DOWN} Down arrow
    {LEFT} Left arrow
    {RIGHT} Right arrow
    {HOME} HOME
    {END} END
    {ESCAPE} or {ESC} ESCAPE
    {INSERT} or {INS} INS
    {PGUP} PageUp
    {PGDN} PageDown
    {F1} - {F12} Function keys
    {TAB} TAB
    {PRINTSCREEN} Print Screen key
    {LWIN} Left Windows key
    {RWIN} Right Windows key
    {NUMLOCK on} NUMLOCK (on/off/toggle)
    {CAPSLOCK off} CAPSLOCK (on/off/toggle)
    {SCROLLLOCK toggle} SCROLLLOCK (on/off/toggle)
    {CTRLBREAK} Ctrl+Break
    {PAUSE} PAUSE
    {NUMPAD0} - {NUMPAD9} Numpad digits
    {NUMPADMULT} Numpad Multiply
    {NUMPADADD} Numpad Add
    {NUMPADSUB} Numpad Subtract
    {NUMPADDIV} Numpad Divide
    {NUMPADDOT} Numpad period
    {NUMPADENTER} Enter key on the numpad
    {APPSKEY} Windows App key
    {LALT} Left ALT key
    {RALT} Right ALT key
    {LCTRL} Left CTRL key
    {RCTRL} Right CTRL key
    {LSHIFT} Left Shift key
    {RSHIFT} Right Shift key
    {SLEEP} Computer SLEEP key
    {ALTDOWN} Holds the ALT key down until {ALTUP} is sent
    {SHIFTDOWN} Holds the SHIFT key down until {SHIFTUP} is sent
    {CTRLDOWN} Holds the CTRL key down until {CTRLUP} is sent
    {LWINDOWN} Holds the left Windows key down until {LWINUP} is sent
    {RWINDOWN} Holds the right Windows key down until {RWINUP} is sent
    {ASC nnnn} Send the ALT+nnnn key combination
    {BROWSER_BACK} 2000/XP Only: Select the browser "back" button
    {BROWSER_FORWARD} 2000/XP Only: Select the browser "forward" button
    {BROWSER_REFRESH} 2000/XP Only: Select the browser "refresh" button
    {BROWSER_STOP} 2000/XP Only: Select the browser "stop" button
    {BROWSER_SEARCH} 2000/XP Only: Select the browser "search" button
    {BROWSER_FAVORITES} 2000/XP Only: Select the browser "favorites" button
    {BROWSER_HOME} 2000/XP Only: Launch the browser and go to the home page
    {VOLUME_MUTE} 2000/XP Only: Mute the volume
    {VOLUME_DOWN} 2000/XP Only: Reduce the volume
    {VOLUME_UP} 2000/XP Only: Increase the volume
    {MEDIA_NEXT} 2000/XP Only: Select next track in media player
    {MEDIA_PREV} 2000/XP Only: Select previous track in media player
    {MEDIA_STOP} 2000/XP Only: Stop media player
    {MEDIA_PLAY_PAUSE} 2000/XP Only: Play/pause media player
    {LAUNCH_MAIL} 2000/XP Only: Launch the email application
    {LAUNCH_MEDIA} 2000/XP Only: Launch media player
    {LAUNCH_APP1} 2000/XP Only: Launch user app1
    {LAUNCH_APP2} 2000/XP Only: Launch user app2


    A-Z , 1-9 geht auch , ansonsten:

    +a: shift (umschalt)= Großes A
    ^: Strg + Alt

    !: Alt

    egal - am besten du liest es dir selber durch :)


    Spoiler anzeigen

    !'
    This tells AutoIt to send an ALT keystroke, therefore Send("This is text!a") would send the keys "This is text" and then press "ALT+a".

    N.B. Some programs are very choosy about capital letters and ALT keys, i.e. "!A" is different to "!a". The first says ALT+SHIFT+A, the second is ALT+a. If in doubt, use lowercase!

    '+'
    This tells AutoIt to send a SHIFT keystroke, therefore Send("Hell+o") would send the text "HellO". Send("!+a") would send "ALT+SHIFT+a".

    '^'
    This tells AutoIt to send a CONTROL keystroke, therefore Send("^!a") would send "CTRL+ALT+a".

    N.B. Some programs are very choosy about capital letters and CTRL keys, i.e. "^A" is different to "^a". The first says CTRL+SHIFT+A, the second is CTRL+a. If in doubt, use lowercase!

    '#'
    The hash now sends a Windows keystroke; therefore, Send("#r") would send Win+r which launches the Run dialog box.

    You can set SendCapslockMode to make CAPS LOCK disabled at the start of a Send operation and restored upon completion.
    However, if a user is holding down the Shift key when a Send function begins, text may be sent in uppercase.
    One workaround is to Send("{SHIFTDOWN}{SHIFTUP}") before the other Send operations.

    Certain keyboard as the Czech one send different characters when using the Shift Key or being in CAPS LOCK enabled and sending a char. Due to the send AutoIt implementation the CAPS LOCKed char will be sent as Shifted one so it will not work.

    Certain special keys can be sent and should be enclosed in braces:

    N.B. Windows does not allow the simulation of the "CTRL-ALT-DEL" combination!


    p.s das ist aus der Help File :)

  • Dankeschön funktioniert.
    Das ist ganz praktisch weil dann brauch mann nicht mehr so viele einzelne Programme.

  • Kann man 2 Tasten Gleichzeitig senden?

    Ich will mit der Tastenkombination "Strg und L" in die Adresszeile von Mozila Firefox wechseln.

    Habe noch nichts zum Thema gefunden.

    Bin für jede Hilfe Dankbar

    MFG
    Doc

    Einmal editiert, zuletzt von doc (23. Mai 2007 um 23:54)

  • ist es auch möglich zb die maustaste 3-4 oder 5 oder auch linke maustaste drückt damit das program aktiviert wird

  • Hallo

    Hotkeyset("5", "Start") so kann ich es mit Tast 5 starten

    Hotkeyset("MouseClick("left")", "Start") wenn ich es mache kommt Fehlermeldung... Ich denke mal das dieser "Hotkeyset" befehl nicht für Maustasten gedacht ist?oder habe ich da irgendwas falsch gemacht?

  • Hallo

    Hotkeyset("5", "Start") so kann ich es mit Tast 5 starten

    Hotkeyset("MouseClick("left")", "Start") wenn ich es mache kommt Fehlermeldung... Ich denke mal das dieser "Hotkeyset" befehl nicht für Maustasten gedacht ist?oder habe ich da irgendwas falsch gemacht?


    Du kannst nur die Tasten nutzen die Send beherscht. http://www.autoitscript.com/autoit3/docs/functions/Send.htm
    Und MouseClick("left") ist sowieso keine Taste sondern eine Funktion.

  • Kann ich dann irgendwas machen wo ich den "Start" befehl mit mouseclick("left") verknüpfen kann?

  • _IsPressed() (Misc.au3) kann auch

    Zitat

    ; 01 Left mouse button
    ; 02 Right mouse button
    ; 04 Middle mouse button (three-button mouse)
    ; 05 Windows 2000/XP: X1 mouse button
    ; 06 Windows 2000/XP: X2 mouse button


    überprüfen