#include <Misc.au3>
$dll = DllOpen("user32.dll")
$string = "atu"
$converted = StringToIsPressed($string)
MsgBox(0,"",$string & @crlf & $converted)
While 1
Sleep(20)
If IsPressedIsPressedCode($converted) Then MsgBox(0,"","Funzt :)")
WEnd
Func StringToIsPressed($string)
If Not StringIsAlNum($string) Then
SetError(-1)
Return -1
EndIf
$endstring = "first"
For $loop = 1 To StringLen($string)
$tmpkey = StringLower(StringTrimLeft(StringLeft($string,$loop),$loop-1))
Switch $tmpkey
Case "a"
$returncode = 41
Case "b"
$returncode = 42
Case "c"
$returncode = 43
Case "d"
$returncode = 44
Case "e"
$returncode = 45
Case "f"
$returncode = 46
Case "g"
$returncode = 47
Case "h"
$returncode = 48
Case "i"
$returncode = 49
Case "j"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "k"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "l"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "m"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "n"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "o"
StringUpper($tmpkey)
$returncode = 4 & $tmpkey
Case "p"
$returncode = 50
Case "q"
$returncode = 51
Case "r"
$returncode = 52
Case "s"
$returncode = 53
Case "t"
$returncode = 54
Case "u"
$returncode = 55
Case "v"
$returncode = 56
Case "w"
$returncode = 57
Case "x"
$returncode = 58
Case "y"
$returncode = 59
Case "z"
$returncode = "5A"
Case 0
$returncode = 3 & $tmpkey
Case 1
$returncode = 3 & $tmpkey
Case 2
$returncode = 3 & $tmpkey
Case 3
$returncode = 3 & $tmpkey
Case 4
$returncode = 3 & $tmpkey
Case 5
$returncode = 3 & $tmpkey
Case 6
$returncode = 3 & $tmpkey
Case 7
$returncode = 3 & $tmpkey
Case 8
$returncode = 3 & $tmpkey
Case 9
$returncode = 3 & $tmpkey
EndSwitch
If $endstring <> "first" Then
$endstring = $endstring & "|" & $returncode
Else
$endstring = $returncode
EndIf
Next
Return $endstring
EndFunc
Func IsPressedIsPressedCode($code)
$split = StringSplit($code,"|")
For $loop = 1 To $split[0]
If _IsPressed($split[$loop],$dll) Then
ContinueLoop
Else
Return False
EndIf
Next
Return True
EndFunc
Hab ich mir grad selbstgebaut, funktioniert supi
Mfg,
Dankeschön