Guten Tag, ich hab ein kleines Script geschrieben, für die DLL von der UDK LogitechLED SDK, damit lässt sich die Tastatur Lichter Farbe der Logitech G15,G19 usw. steuern.
Edit: Neue DLL (welche direkt bei der Logitech Gaming Software dabei ist) + 2 neue Funktionen
Keine Ahnung wie sinnvoll man das betrachten kann, aber man spart sich die Arbeit, ständig DllCall zu benutzen, außerdem bietet die UDK DLL alle nötigen Funktionen.
Script für die DLL
Spoiler anzeigen
#include-once
;GLOBALS
Global Const $LED_MOUSE = 0x0001 ;wird bei Set,Save und Restore benutzt, auswählen zwischen Maus oder Keyboard
Global Const $LED_KEYBOARD = 0x0002 ;mit OR verknüpfen für ALLE Geräte
Global $dllLED = 0
Global $callback = -1
;------------------------------LED steuerung, sollte selbsterklärend sein
;LogiLedInit()
;LogiLedSet($LED_KEYBOARD, r, g, b)
;LogiLedDeInit()
Func LogiLedInit($sDLLPathLED = "LogitechLed.dll")
$dllLED = DLLOpen($sDLLPathLED)
Local $ret = DllCall($dllLED, "bool:cdecl", "LogiLedInit")
If @error Then
Return SetError(1, @error, 0)
Else
Return $ret[0]
EndIf
EndFunc
Func LogiLedDeInit()
If $callback <> -1 Then DllCallbackFree($callback)
Local $ret = DllCall($dllLED, "none:cdecl", "LogiLedShutdown")
If @error Then Return SetError(1, @error, 0)
DllClose($dllLED)
Return $ret[0]
EndFunc
;Red, Green, Blue können werte zwischen 0 und 100 einnehmen (stellt Prozent dar)
Func LogiLedSet($iKeyboadMouse = $LED_KEYBOARD, $iRed= 0, $iGreen = 0, $iBlue = 0)
Local $ret = DllCall($dllLED, "bool:cdecl", "LogiLedSetLighting", "int", $iKeyboadMouse, "int", $iRed, "int", $iGreen, "int", $iBlue)
If @error Then Return SetError(1, @error, 0)
Return $ret[0]
EndFunc
;Speichert aktuelle Farbe der Beleuchtung, z.B. für temporäre Änderung (Warning etc.)
Func LogiLedSave($iKeyboadMouse = $LED_KEYBOARD)
Local $ret = DllCall($dllLED, "bool:cdecl", "LogiLedSaveCurrentLighting", "int", $iKeyboadMouse)
If @error Then Return SetError(1, @error, 0)
Return $ret[0]
EndFunc
;Stellt die mit "LogiLedSave(...)" gespeicherte Beleuchtung wieder her
Func LogiLedRestore($iKeyboadMouse = $LED_KEYBOARD)
Local $ret = DllCall($dllLED, "bool:cdecl", "LogiLedRestoreLighting", "int", $iKeyboadMouse)
If @error Then Return SetError(1, @error, 0)
Return $ret[0]
EndFunc
;pulsiert im 3s Takt, $iTime gibt an wie lange pulsiert wird
Func LogiLedPulse($iKeyboadMouse = $LED_KEYBOARD, $iRed= 0, $iGreen = 0, $iBlue = 0, $iTime = 0)
Local $ret = DllCall($dllLED, "bool:cdecl", "LogiLedPulseLighting", "int", $iKeyboadMouse, "int", $iRed, "int", $iGreen, "int", $iBlue, "int", $iTime)
If @error Then Return SetError(1, @error, 0)
Return $ret[0]
EndFunc
;gibt den Helligkeitswert in Prozent zurück, 0-99
Func LogiLedGet($iKeyboadMouse = $LED_KEYBOARD)
Local $ret = DllCall($dllLED, "int:cdecl", "LogiLedGetCurrentBrightnessPercentage", "int", $iKeyboadMouse)
If @error Then Return SetError(1, @error, 0)
Return $ret[0]
EndFunc
;Return ist bei allen: erfolg 1, ansonsten 0
;LogiLedInit() muss vor den anderen Funktionen aufgerufen werden
Kleines Beispiel
Spoiler anzeigen
#include <LED.au3>
$sDLLPathLED = @ScriptDir & "\LogitechLed.dll"
LogiLedInit($sDLLPathLED)
LogiLedSet($LED_KEYBOARD, 50, 0, 0)
ToolTip("Helligkeit: " & LogiLedGet($LED_KEYBOARD), 100, 100)
sleep(2000)
LogiLedDeInit()
Kleiner Auszug aus der Dokumentation, welche Geräte unterstützt werden:
Spoiler anzeigen
G710
Single color only. Full resolution. Highest value for R, G or B defines brightness.
G600
Supports full RGB.
G510
Supports full RGB.
G110
Supports full R(ed) and B(lue), but not G(reen). When calling the SDK’s LogiLedSetLighting function, values for green will be ignored.
G19
Supports full RGB.
G105 / G105 CoD Edition
Single color only. Full resolution. Highest value for R, G or B defines brightness.
G300
Supports red on/off, green on/off, blue on/off, or a combination of the three. When calling the SDK’s LogiLedSetLighting function, if the percentage given is below 50, the color will be off, and when above 50, the color will be on.
G11
Single color only, 3 levels of brightness. When calling the SDK’s LogiLedSetLighting function, if the highest RGB percentage given is below 33, the color will be off,
G13
The SDK treats this device as a keyboard.
Supports full RGB.
G15 v1+v2
Single color only, 3 levels of brightness. When calling the SDK’s LogiLedSetLighting function, if the highest RGB percentage given is below 33, the color will be off, if between 33 and 66, the brightness will be low, and when above 66, the brightness will be high.
Im Anhang noch die DLL + die beiden Scripte. (Ich benutze die x86 DLL, aus oben genanntem Link)
FG, No0n3.