From fc86f2af4430725155dd6d6203df8d349a75aeb8 Mon Sep 17 00:00:00 2001 From: MohamadSaada Date: Sun, 1 Jan 2017 13:27:51 +0000 Subject: [PATCH] Update Keyboard.cpp --- src/classes/Keyboard.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index fe548f3..e72d7fd 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -641,12 +641,22 @@ bool Keyboard::setPowerOnEffect(PowerOnEffect powerOnEffect) { bool retval = false; int data_size = 20; unsigned char *data = new unsigned char[data_size]; - data[0] = 0x11; // Base address - data[1] = 0xff; // Base address - data[2] = 0x0d; // Base address - data[3] = 0x5a; // Base address - data[4] = 0x00; // Base address - data[5] = 0x01; // Base address + switch (kbdProtocol) { + case KeyboardProtocol::generic: + data[0] = 0x11; // Base address + data[1] = 0xff; // Base address + data[2] = 0x0d; // Base address + data[3] = 0x5a; // Base address + data[4] = 0x00; // Base address + data[5] = 0x01; // Base address + case KeyboardProtocol::g910: + data[0] = 0x11; // Base address + data[1] = 0xff; // Base address + data[2] = 0x10; // Base address + data[3] = 0x5e; // Base address + data[4] = 0x00; // Base address + data[5] = 0x01; // Base address + } switch (powerOnEffect) { case PowerOnEffect::rainbow: data[6] = 0x01;