Hallo liebe Au3-Gemeinde,
hat jemand von euch eine Idee warum das angehängte Script nicht funktioniert ?
Zur Vorbeugung : Nein es wird kein Keylogger, da würde ich was anderes nehmen.
Ich will das ein Nutzer bei Aufruf der Funktion maximal 2 Tasten drücken kann die dann so zu sagen
als Benutzerdefinierter Hotkey funktionieren.
Leider scheitert das ganze bei der Aufnahme der Hotkeys.
Laut meinem Verständnis sollte das Script eigentlich so den Code des gedrückten Keys in die Konsole schreiben.
Leider funktioniert das bei mir nicht.
Auch nicht mit ReqAdmin.
Vielleicht bin ich nur mal wieder etwas Blind trotz Brille, jedoch möchte ich euch bitten das mal an zu schauen ob jemand meinen Fehler findet.
Suche wurde benutzt leider hab ich dazu nichts gefunden.
//EDIT
Der Code wurde wohl durch C&P verschoben. Sollte aber so zumindest teilweise funktionieren (evlt & _ anpassen)
Dim $keyarray = ["01","Left mouse button","02","Right mouse button","03","Control-break processing","04","Middle mouse button (three-button mouse)" & _
"","05","X1 mouse button","06","X2 mouse button","08","BACKSPACE","09","TAB","0C","CLEAR","0D","ENTER","10","SHIFT","11","CTRL","12","ALT","13" & _
"","PAUSE","14","CAPS LOCK","20","SPACEBAR","21","PAGE UP","22","PAGE DOWN","23","END","24","HOME","25","LEFT ARROW","26","UP ARROW","27" & _
"","RIGHT ARROW","28","DOWN ARROW","29","SELECT","2A","PRINT","2B","EXECUTE","2C","PRINT SCREEN","2D","INS","2E","DEL","30","0","31","1","32","2","33","3" & _
"","34","4","35","5","36","6","37","7","38","8","39","9","41","A","42","B","43","C","44","D","45","E","46","F","47","G","48","H","49","I","4A","J","4B","K","4C" & _
"","L","4D","M","4E","N","4F","O","50","P","51","Q","52","R","53","S","54","T","55","U","56","V","57","W","58","X","59","Y","5A","Z","5B","Left Windows","5C","Right Windows","60" & _
"","Numericpad 0","61","Numericpad 1","62","Numericpad 2","63","Numericpad 3","64","Numericpad 4","65","Numericpad 5","66","Numericpad 6","67","Numericpad 7","68" & _
"","Numericpad 8","69","Numericpad 9","6A","Multiply","6B","Add","6C","Separator","6D","Subtract","6E","Decimal","6F","Divide","70","F1","71","F2","72","F3","73","F4","74" & _
"","F5","75","F6","76","F7","77","F8","78","F9","79","F10","7A","F11","7B","F12","90","NUM LOCK","91","SCROLL LOCK","A0","Left SHIFT","A1","Right SHIFT","A2","Left CONTROL" & _
"","A3","Right CONTROL","A4","Left MENU","A5","Right MENU","BA",";","BB","=","BC",",","BD","-","BE",".","BF","/","C0","`","DB","[","DC","\","DD","]"]
Func TrackKey()
$pressed = ""
$pos = MouseGetPos()
ToolTip ("Please press max. 2 keys in turn.",$pos[0],$pos[1],"Info",1,7)
Sleep(2500)
ToolTip("")
Local $hDLL = DllOpen("user32.dll")
$TrackKeys = True
While $TrackKeys
For $i=1 To UBound($keyarray) Step +2
$x = _IsPressed($keyarray[$i],$hDLL)
If $x=$keyarray[$i] Then
ConsoleWrite("Key Pressed : "&$keyarray[$i]-1&@CRLF)
Sleep(10)
EndIf
Next
WEnd
EndFunc
Alles anzeigen