es gibt ja den Befehl MousePos, der angibt wo sich der zeiger grade befindet.
Gibt es auch einen, oder irgend was das ausgibt ob grade gedrückt ist ????
MousePos für klicks????
-
- [ gelöst ]
-
TheLol -
21. April 2008 um 18:03 -
Geschlossen -
Erledigt
-
-
_IsPressed("01") und _IsPressed("02")
-
wie müsste dan so was ausehen?
[autoit]
[/autoit][autoit][/autoit][autoit][/autoit]
_IsPressed("01")
Func _IsPressed("01")
MsgBox (0,"TEST","angekommen")
EndFunc -
Wenn du überprüfen willst, ob eine taste gedrückt wurde dann brauchst du eine schleife.
[autoit]#include <misc.au3>
[/autoit][autoit][/autoit][autoit]while 1
[/autoit][autoit][/autoit][autoit]
If _IsPressed("01") Then _pressed()
sleep(100)
WEndFunc _pressed()
[/autoit]
MsgBox (0,"TEST","angekommen")
EndFunc// sorry
-
[autoit]
#include<Misc.au3> ; Wars glaub ich
[/autoit]
While 1
If _IsPressed('01') Then MsgBox(0,"","Links gedrückt")
WEnd
// Och nee -
Ich hab mal ne kleine Spielerei gebastelt^^, jetzt kann man was in paint malen, und es dan weider nach malen lassen xD.
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <misc.au3>
$VorFrage = InputBox("Achtung", "Wie lange soll aufgezeichnet werden?")For $i = $VorFrage To 1 Step -1
[/autoit] [autoit][/autoit] [autoit]
Sleep(10)
If _IsPressed("01") Then
IniWrite("cords.ini", "" & $i & "", "maus", "1")
EndIf
If _IsPressed("02") Then
IniWrite("cords.ini", "" & $i & "", "maus", "2")
EndIf
$pos = MouseGetPos()
IniWrite("cords.ini", "" & $i & "", "pos 0", "" & $pos[0] & "")
IniWrite("cords.ini", "" & $i & "", "pos 1", "" & $pos[1] & "")
TrayTip("Hinweis", "" & $i & "/" & $VorFrage & "", 1)
Next
MouseUp("left")
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(36, "Achtung", "Soll die aufzeichnung wieder ausgegeben werden?")
Select
Case $iMsgBoxAnswer = 6 ;Yes
_ausgabe()
Case $iMsgBoxAnswer = 7 ;No
Exit
EndSelectFunc _ausgabe()
[/autoit] [autoit][/autoit] [autoit][/autoit]
For $i = $VorFrage To 1 Step -1
$pos = MouseGetPos()
If IniRead("cords.ini", "" & $i & "", "maus", "") = 1 Then
MouseDown("left")
EndIf
If IniRead("cords.ini", "" & $i & "", "maus", "") = 2 Then
MouseDown("right")
EndIf
$pos1 = IniRead("cords.ini", "" & $i & "", "pos 0", "")
$pos2 = IniRead("cords.ini", "" & $i & "", "pos 1", "")
MouseMove($pos1, $pos2, 1)
MouseUp("left")
TrayTip("Hinweis", "" & $i & "/" & $VorFrage & "", 1)
Next
MouseUp("left")
MsgBox(0, "Hinweis", "fertig")
EndFunc ;==>_ausgabe -
Ich habs noch nen bissel verbessert^^. Aber jetzt erkennts nicht immer so gut ob gedrückt ist, bzw. gibt es schlecht wieder
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
HotKeySet("!a", "_abbruch")Func _abbruch()
[/autoit] [autoit][/autoit] [autoit]
Exit
EndFunc ;==>_abbruch#include <misc.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>$i = 0
[/autoit] [autoit][/autoit] [autoit]
$iIn = 0
$WarteZeit = 1000#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Maus-Logger", 203, 187, 193, 125)
$Label1 = GUICtrlCreateLabel("Wie lange soll aufgezeichnet werden?", 8, 0, 184, 17)
$Radio1 = GUICtrlCreateRadio("1 Minute", 8, 16, 73, 17)
$Radio2 = GUICtrlCreateRadio("2 Minuten", 8, 40, 73, 17)
$Radio3 = GUICtrlCreateRadio("5 Minuten", 8, 64, 73, 17)
$Radio4 = GUICtrlCreateRadio("10 Minuten", 8, 88, 73, 17)
$Radio5 = GUICtrlCreateRadio("Unendlich", 8, 112, 73, 17)
$Button1 = GUICtrlCreateButton("Starte aufzeichnen", 96, 24, 99, 25, 0)
$Button2 = GUICtrlCreateButton("Starte ausgabe", 96, 64, 99, 25, 0)
$Button3 = GUICtrlCreateButton("Öffne Log-Datei", 96, 104, 99, 25, 0)
$Input1 = GUICtrlCreateInput("", 128, 136, 33, 21)
$Label2 = GUICtrlCreateLabel("Warte-Zeit bis start:", 8, 138, 117, 17)
$Label3 = GUICtrlCreateLabel("sec.", 174, 138, 23, 17)
$MenuItem1 = GUICtrlCreateMenu("Menu")
$MenuItem2 = GUICtrlCreateMenuItem("Optionen", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenu("Hilfe")
$MenuItem5 = GUICtrlCreateMenuItem("Credits", $MenuItem4)
$MenuItem6 = GUICtrlCreateMenuItem("Hilfe", $MenuItem4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_vorauslesen()
Case $Button2
_ausgabe()EndSwitch
[/autoit] [autoit][/autoit] [autoit]
WEndFunc _vorauslesen()
[/autoit] [autoit][/autoit] [autoit]
$WarteZeit = GUICtrlRead ($Input1) * 1000
If GUICtrlRead($Radio1) = $GUI_CHECKED Then
$iIn = 1000
ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then
$iIn = 1000 * 2
ElseIf GUICtrlRead($Radio3) = $GUI_CHECKED Then
$iIn = 1000 * 5
ElseIf GUICtrlRead($Radio1) = $GUI_CHECKED Then
$iIn = 1000 * 10
ElseIf GUICtrlRead($Radio1) = $GUI_CHECKED Then
$iIn = 1000 * 99999999
Else
MsgBox (0,"Achtung","Bitte Länge der Aufzeichnung wählen!!!")
EndIf
_startAuslesen()
EndFuncFunc _startAuslesen()
[/autoit] [autoit][/autoit] [autoit]
Sleep ($WarteZeit)
For $i = $iIn To 1 Step -1
Sleep(10)
If _IsPressed("01") Then
IniWrite("cords.ini", "" & $i & "", "maus", "1")
EndIf
$pos = MouseGetPos()
IniWrite("cords.ini", "" & $i & "", "pos 0", "" & $pos[0] & "")
IniWrite("cords.ini", "" & $i & "", "pos 1", "" & $pos[1] & "")
TrayTip("Hinweis", "Noch: " & $i & "/" & $iIn & " Log´s", 1)
Next
MouseUp("left")
MsgBox(0, "Hinweis", "fertig")
EndFuncFunc _ausgabe()
[/autoit]
Sleep($WarteZeit)
For $i = $iIn To 1 Step -1
$pos = MouseGetPos()
If IniRead("cords.ini", "" & $i & "", "maus", "") = 1 Then
MouseDown("left")
EndIf
$pos1 = IniRead("cords.ini", "" & $i & "", "pos 0", "")
$pos2 = IniRead("cords.ini", "" & $i & "", "pos 1", "")
MouseMove($pos1, $pos2, 1)
MouseUp("left")
TrayTip("Hinweis", "Noch: " & $i & "/" & $iIn & " Log´s", 1)
Next
MouseUp("left")
MouseUp("right")
MsgBox(0, "Hinweis", "fertig")
EndFunc ;==>_ausgabe