goktanu
Çalışkan
- Katılım
- 31 Temmuz 2026
- Mesajlar
- 8
- Beğeniler
- 1
Gemini sağ olsun, çalışan bir plugin yaptım.
Belgelerim\WhirlwindFX\Plugins yolunda yeni bir metin belgesi oluşturup aşağıdaki kodu içine atın ve sonra "Wraith_W75_V2.js" şeklinde kaydedin. SignalRGB'yi yeniden başlattığınızda cihazınızı görecektir.
Belgelerim\WhirlwindFX\Plugins yolunda yeni bir metin belgesi oluşturup aşağıdaki kodu içine atın ve sonra "Wraith_W75_V2.js" şeklinde kaydedin. SignalRGB'yi yeniden başlattığınızda cihazınızı görecektir.
JavaScript:
export function Name() { return "Wraith W75 V2"; }
export function VendorId() { return 0x2E3C; }
export function ProductId() { return 0xC368; }
export function Publisher() { return "WhirlwindFx"; }
export function Size() { return [15, 6]; }
export function DefaultPosition() { return [0, 0]; }
export function DefaultScale() { return 8.0; }
export function DeviceType() { return "keyboard"; }
export function Validate(endpoint) {
return endpoint.interface === 2 && endpoint.usage === 0x0091 && endpoint.usage_page === 0xFF1B && endpoint.collection === 0x0000;
}
export function ControllableParameters() {
return [
{property:"shutdownColor", group:"lighting", label:"Shutdown Color", description: "This color is applied to the device when the System, or SignalRGB is shutting down", min:"0", max:"360", type:"color", default:"#000000"},
{property:"LightingMode", group:"lighting", label:"Lighting Mode", description: "Determines where the device's RGB comes from. Canvas will pull from the active Effect, while Forced will override it to a specific color", type:"combobox", values:["Canvas", "Forced"], default:"Canvas"},
{property:"forcedColor", group:"lighting", label:"Forced Color", description: "The color used when 'Forced' Lighting Mode is enabled", min:"0", max:"360", type:"color", default:"#009bde"},
];
}
const vLedNames = [
"Esc", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "Del",
"`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-_", "=+", "Backspace", "Insert",
"Tab", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]", "\\", "PgUp",
"CapsLock", "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "'", "Enter", "PgDn",
"Left Shift", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "Right Shift", "Up Arrow",
"Left Ctrl", "Left Win", "Left Alt", "Space", "Right Alt", "Fn", "Menu", "Left Arrow", "Down Arrow", "Right Arrow"
];
const vLeds = [
0, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37,
44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59,
66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 84,
88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 102, 104,
110, 111, 112, 116, 120, 121, 122, 125, 126, 127
];
const vLedPositions = [
[0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [6, 0], [7, 0], [8, 0], [9, 0], [10, 0], [11, 0], [12, 0], [13, 0], [14, 0],
[0, 1], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1], [10, 1], [11, 1], [12, 1], [13, 1], [14, 1],
[0, 2], [1, 2], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2], [7, 2], [8, 2], [9, 2], [10, 2], [11, 2], [12, 2], [13, 2], [14, 2],
[0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], [8, 3], [9, 3], [10, 3], [11, 3], [13, 3], [14, 3],
[0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], [7, 4], [8, 4], [9, 4], [10, 4], [12, 4], [13, 4],
[0, 5], [1, 5], [2, 5], [6, 5], [9, 5], [10, 5], [11, 5], [12, 5], [13, 5], [14, 5]
];
export function LedNames() { return vLedNames; }
export function LedPositions() { return vLedPositions; }
export function Initialize() {
device.setName("Wraith W75 V2");
device.setSize([15, 6]);
device.setControllableLeds(vLedNames, vLedPositions);
// Nuvoton Direct Lighting Mode baslatma paketleri
device.write([0x01, 0x07, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x04, 0x03, 0xFF], 64);
device.write([0x01, 0x17, 0x00, 0x00, 0x00, 0x01, 0x01], 64);
device.write([0x01, 0x08, 0x00, 0x00, 0x00, 0x0D, 0x02, 0x03, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], 64);
}
export function Render() {
sendColors();
}
export function Shutdown(SystemSuspending) {
const color = SystemSuspending ? "#000000" : shutdownColor;
sendColors(color);
}
function sendColors(overrideColor) {
const RGBData = new Array(132 * 3).fill(0);
for (let iIdx = 0; iIdx < vLeds.length; iIdx++) {
const iPxX = vLedPositions[iIdx][0];
const iPxY = vLedPositions[iIdx][1];
let color;
if (overrideColor) {
color = hexToRgb(overrideColor);
} else if (typeof LightingMode !== "undefined" && LightingMode === "Forced") {
color = hexToRgb(forcedColor);
} else {
color = device.color(iPxX, iPxY);
}
const ledIndex = vLeds[iIdx] * 3;
RGBData[ledIndex] = color[0];
RGBData[ledIndex + 1] = color[1];
RGBData[ledIndex + 2] = color[2];
}
let packetCount = 0;
let zoneTotalLEDs = RGBData.length / 3;
while (zoneTotalLEDs > 0) {
const ledsToSend = zoneTotalLEDs >= 18 ? 18 : zoneTotalLEDs;
const header = [0x01, 0x0F, 0x00, 0x00, packetCount, ledsToSend * 3];
const data = RGBData.splice(0, ledsToSend * 3);
const packet = header.concat(data);
device.write(packet, 65);
zoneTotalLEDs -= ledsToSend;
packetCount++;
device.pause(1);
}
device.write([0x01, 0x0F, 0x01, 0x00, 0x00, 0x36], 65);
device.write([0x01, 0x0F, 0x01, 0x00, 0x01, 0x2D], 65);
device.pause(1);
}
function hexToRgb(hex) {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
if (!result) return [0, 0, 0];
return [
parseInt(result[1], 16),
parseInt(result[2], 16),
parseInt(result[3], 16)
];
}