Hallo CentuCore.
Nein mit AutoIt schon jedoch mit DLL's das ist das erste "Projekt" wo DLL's vorhanden sind.
Ok hab das mit dem CB rausgenommen, jedoch bekomme ich trotzdem dauernd Fehler in der Zeile 15 (DllCall 'LogiGkeyInit').
Spoiler anzeigen
$callback = -1
[/autoit] [autoit][/autoit] [autoit]$Strukt = DllStructCreate("ptr context; ptr callback")
$callback = DllCallbackRegister("_Callback", "none:cdecl", "dword;wstr;ptr")
$Strukt.context = Null
$Strukt.callback = DllCallbackGetPtr($callback)
$dll = @ScriptDir & "\GKY.dll"
[/autoit] [autoit][/autoit] [autoit]$DO = DllOpen ($dll)
If @error Then MsgBox (0, "ERROR", "DllOpen")
MsgBox (0, "INFO", DllStructGetPtr($Strukt))
$DC_IN = DllCall ($DO, "bool:cdecl", "LogiGkeyInit", "ptr", DllStructGetPtr($Strukt))
If @error Then MsgBox (0, "ERROR", "DllCall 'LogiGkeyInit'" & @CRLF & @CRLF & $DC_IN)
While True
$DC = DllCall ($DO, "bool:cdecl", "LogiGkeyIsKeyboardGkeyPressed", "int", 10)
ToolTip ($DC)
Sleep (500)
WEnd
Func _Callback($keycode, $btnname, $context) ;$context ist struct.context
$key_idx = BitAnd($keycode, 0xff)
$key_down = BitAnd(BitShift($keycode, 8), 0x01)
$m_state = BitAnd(BitShift($keycode, 9), 0x03)
$is_from_mouse = BitAnd(BitShift($keycode, 10), 0x01)
EndFunc