public void LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, Color color) { int red, green, blue; ColorToPercentagesTuple(color, out red, out green, out blue); LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(keyCode, red, green, blue); }
protected void SetLogitechColorFromCoordinates(Bitmap bitmap, keyboardNames key, int x, int y) { var color = bitmap.GetPixel(x, y); var rPer = (int)Math.Round(color.R / 2.55); var gPer = (int)Math.Round(color.G / 2.55); var bPer = (int)Math.Round(color.B / 2.55); LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(key, rPer, gPer, bPer); }
public void GKeyMimicLightState(keyboardNames key, LightState state) { if (state != null && state.on) { // Scale hue, sat, brightness double H = state.hue * (360.0 / 65535); double S = state.sat * (1.0 / 254); double L = state.bri * (1.0 / 254); LogitechLEDGSDK.LogiLedSetLightingForKeyWithKeyName(key, HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.R), HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.G), HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.B)); } else { LogitechLEDGSDK.LogiLedSetLightingForKeyWithKeyName(key, 0, 0, 0); } }
private void ActivateKey() { keyboardNames name = keyboardNames.PAUSE_BREAK; while (name == keyboardNames.PAUSE_BREAK) { try { Array keysValues = Enum.GetValues(typeof(Keys)); ActiveKey = (Keys)keysValues.GetValue(random.Next(keysValues.Length)); name = ToLogitechKeyboardName(ActiveKey); } catch (ArgumentOutOfRangeException ex) { continue; } } LogitechGSDK.LogiLedSetLighting(0, 0, 0); LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(name, 100, 0, 0); }
public static extern bool LogiLedFlashSingleKey(keyboardNames keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval);
public static extern bool LogiLedRestoreLightingForKey(keyboardNames keyName);
public static extern bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, int redPercentage, int greenPercentage, int bluePercentage);
public static extern bool LogiLedStopEffectsOnKey(keyboardNames keyName);
public static extern bool LogiLedPulseSingleKey(keyboardNames keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite);
private static bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, System.Drawing.Color color) { return(LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(keyCode, color.R * 100 / 255, color.G * 100 / 255, color.B * 100 / 255)); }
public static Logitech_keyboardBitmapKeys ToLogitechBitmap(keyboardNames key) { switch (key) { case (keyboardNames.ESC): return(Logitech_keyboardBitmapKeys.ESC); case (keyboardNames.F1): return(Logitech_keyboardBitmapKeys.F1); case (keyboardNames.F2): return(Logitech_keyboardBitmapKeys.F2); case (keyboardNames.F3): return(Logitech_keyboardBitmapKeys.F3); case (keyboardNames.F4): return(Logitech_keyboardBitmapKeys.F4); case (keyboardNames.F5): return(Logitech_keyboardBitmapKeys.F5); case (keyboardNames.F6): return(Logitech_keyboardBitmapKeys.F6); case (keyboardNames.F7): return(Logitech_keyboardBitmapKeys.F7); case (keyboardNames.F8): return(Logitech_keyboardBitmapKeys.F8); case (keyboardNames.F9): return(Logitech_keyboardBitmapKeys.F9); case (keyboardNames.F10): return(Logitech_keyboardBitmapKeys.F10); case (keyboardNames.F11): return(Logitech_keyboardBitmapKeys.F11); case (keyboardNames.F12): return(Logitech_keyboardBitmapKeys.F12); case (keyboardNames.PRINT_SCREEN): return(Logitech_keyboardBitmapKeys.PRINT_SCREEN); case (keyboardNames.SCROLL_LOCK): return(Logitech_keyboardBitmapKeys.SCROLL_LOCK); case (keyboardNames.PAUSE_BREAK): return(Logitech_keyboardBitmapKeys.PAUSE_BREAK); case (keyboardNames.TILDE): return(Logitech_keyboardBitmapKeys.TILDE); case (keyboardNames.ONE): return(Logitech_keyboardBitmapKeys.ONE); case (keyboardNames.TWO): return(Logitech_keyboardBitmapKeys.TWO); case (keyboardNames.THREE): return(Logitech_keyboardBitmapKeys.THREE); case (keyboardNames.FOUR): return(Logitech_keyboardBitmapKeys.FOUR); case (keyboardNames.FIVE): return(Logitech_keyboardBitmapKeys.FIVE); case (keyboardNames.SIX): return(Logitech_keyboardBitmapKeys.SIX); case (keyboardNames.SEVEN): return(Logitech_keyboardBitmapKeys.SEVEN); case (keyboardNames.EIGHT): return(Logitech_keyboardBitmapKeys.EIGHT); case (keyboardNames.NINE): return(Logitech_keyboardBitmapKeys.NINE); case (keyboardNames.ZERO): return(Logitech_keyboardBitmapKeys.ZERO); case (keyboardNames.MINUS): return(Logitech_keyboardBitmapKeys.MINUS); case (keyboardNames.EQUALS): return(Logitech_keyboardBitmapKeys.EQUALS); case (keyboardNames.BACKSPACE): return(Logitech_keyboardBitmapKeys.BACKSPACE); case (keyboardNames.INSERT): return(Logitech_keyboardBitmapKeys.INSERT); case (keyboardNames.HOME): return(Logitech_keyboardBitmapKeys.HOME); case (keyboardNames.PAGE_UP): return(Logitech_keyboardBitmapKeys.PAGE_UP); case (keyboardNames.NUM_LOCK): return(Logitech_keyboardBitmapKeys.NUM_LOCK); case (keyboardNames.NUM_SLASH): return(Logitech_keyboardBitmapKeys.NUM_SLASH); case (keyboardNames.NUM_ASTERISK): return(Logitech_keyboardBitmapKeys.NUM_ASTERISK); case (keyboardNames.NUM_MINUS): return(Logitech_keyboardBitmapKeys.NUM_MINUS); case (keyboardNames.TAB): return(Logitech_keyboardBitmapKeys.TAB); case (keyboardNames.Q): return(Logitech_keyboardBitmapKeys.Q); case (keyboardNames.W): return(Logitech_keyboardBitmapKeys.W); case (keyboardNames.E): return(Logitech_keyboardBitmapKeys.E); case (keyboardNames.R): return(Logitech_keyboardBitmapKeys.R); case (keyboardNames.T): return(Logitech_keyboardBitmapKeys.T); case (keyboardNames.Y): return(Logitech_keyboardBitmapKeys.Y); case (keyboardNames.U): return(Logitech_keyboardBitmapKeys.U); case (keyboardNames.I): return(Logitech_keyboardBitmapKeys.I); case (keyboardNames.O): return(Logitech_keyboardBitmapKeys.O); case (keyboardNames.P): return(Logitech_keyboardBitmapKeys.P); case (keyboardNames.OPEN_BRACKET): return(Logitech_keyboardBitmapKeys.OPEN_BRACKET); case (keyboardNames.CLOSE_BRACKET): return(Logitech_keyboardBitmapKeys.CLOSE_BRACKET); case (keyboardNames.BACKSLASH): return(Logitech_keyboardBitmapKeys.BACKSLASH); case (keyboardNames.KEYBOARD_DELETE): return(Logitech_keyboardBitmapKeys.KEYBOARD_DELETE); case (keyboardNames.END): return(Logitech_keyboardBitmapKeys.END); case (keyboardNames.PAGE_DOWN): return(Logitech_keyboardBitmapKeys.PAGE_DOWN); case (keyboardNames.NUM_SEVEN): return(Logitech_keyboardBitmapKeys.NUM_SEVEN); case (keyboardNames.NUM_EIGHT): return(Logitech_keyboardBitmapKeys.NUM_EIGHT); case (keyboardNames.NUM_NINE): return(Logitech_keyboardBitmapKeys.NUM_NINE); case (keyboardNames.NUM_PLUS): return(Logitech_keyboardBitmapKeys.NUM_PLUS); case (keyboardNames.CAPS_LOCK): return(Logitech_keyboardBitmapKeys.CAPS_LOCK); case (keyboardNames.A): return(Logitech_keyboardBitmapKeys.A); case (keyboardNames.S): return(Logitech_keyboardBitmapKeys.S); case (keyboardNames.D): return(Logitech_keyboardBitmapKeys.D); case (keyboardNames.F): return(Logitech_keyboardBitmapKeys.F); case (keyboardNames.G): return(Logitech_keyboardBitmapKeys.G); case (keyboardNames.H): return(Logitech_keyboardBitmapKeys.H); case (keyboardNames.J): return(Logitech_keyboardBitmapKeys.J); case (keyboardNames.K): return(Logitech_keyboardBitmapKeys.K); case (keyboardNames.L): return(Logitech_keyboardBitmapKeys.L); case (keyboardNames.SEMICOLON): return(Logitech_keyboardBitmapKeys.SEMICOLON); case (keyboardNames.APOSTROPHE): return(Logitech_keyboardBitmapKeys.APOSTROPHE); //case (keyboardNames.HASHTAG): // return Logitech_keyboardBitmapKeys.HASHTAG; case (keyboardNames.ENTER): return(Logitech_keyboardBitmapKeys.ENTER); case (keyboardNames.NUM_FOUR): return(Logitech_keyboardBitmapKeys.NUM_FOUR); case (keyboardNames.NUM_FIVE): return(Logitech_keyboardBitmapKeys.NUM_FIVE); case (keyboardNames.NUM_SIX): return(Logitech_keyboardBitmapKeys.NUM_SIX); case (keyboardNames.LEFT_SHIFT): return(Logitech_keyboardBitmapKeys.LEFT_SHIFT); //case (keyboardNames.BACKSLASH_UK): // return Logitech_keyboardBitmapKeys.BACKSLASH_UK; case (keyboardNames.Z): return(Logitech_keyboardBitmapKeys.Z); case (keyboardNames.X): return(Logitech_keyboardBitmapKeys.X); case (keyboardNames.C): return(Logitech_keyboardBitmapKeys.C); case (keyboardNames.V): return(Logitech_keyboardBitmapKeys.V); case (keyboardNames.B): return(Logitech_keyboardBitmapKeys.B); case (keyboardNames.N): return(Logitech_keyboardBitmapKeys.N); case (keyboardNames.M): return(Logitech_keyboardBitmapKeys.M); case (keyboardNames.COMMA): return(Logitech_keyboardBitmapKeys.COMMA); case (keyboardNames.PERIOD): return(Logitech_keyboardBitmapKeys.PERIOD); case (keyboardNames.FORWARD_SLASH): return(Logitech_keyboardBitmapKeys.FORWARD_SLASH); case (keyboardNames.RIGHT_SHIFT): return(Logitech_keyboardBitmapKeys.RIGHT_SHIFT); case (keyboardNames.ARROW_UP): return(Logitech_keyboardBitmapKeys.ARROW_UP); case (keyboardNames.NUM_ONE): return(Logitech_keyboardBitmapKeys.NUM_ONE); case (keyboardNames.NUM_TWO): return(Logitech_keyboardBitmapKeys.NUM_TWO); case (keyboardNames.NUM_THREE): return(Logitech_keyboardBitmapKeys.NUM_THREE); case (keyboardNames.NUM_ENTER): return(Logitech_keyboardBitmapKeys.NUM_ENTER); case (keyboardNames.LEFT_CONTROL): return(Logitech_keyboardBitmapKeys.LEFT_CONTROL); case (keyboardNames.LEFT_WINDOWS): return(Logitech_keyboardBitmapKeys.LEFT_WINDOWS); case (keyboardNames.LEFT_ALT): return(Logitech_keyboardBitmapKeys.LEFT_ALT); case (keyboardNames.SPACE): return(Logitech_keyboardBitmapKeys.SPACE); case (keyboardNames.RIGHT_ALT): return(Logitech_keyboardBitmapKeys.RIGHT_ALT); case (keyboardNames.RIGHT_WINDOWS): return(Logitech_keyboardBitmapKeys.RIGHT_WINDOWS); case (keyboardNames.APPLICATION_SELECT): return(Logitech_keyboardBitmapKeys.APPLICATION_SELECT); case (keyboardNames.RIGHT_CONTROL): return(Logitech_keyboardBitmapKeys.RIGHT_CONTROL); case (keyboardNames.ARROW_LEFT): return(Logitech_keyboardBitmapKeys.ARROW_LEFT); case (keyboardNames.ARROW_DOWN): return(Logitech_keyboardBitmapKeys.ARROW_DOWN); case (keyboardNames.ARROW_RIGHT): return(Logitech_keyboardBitmapKeys.ARROW_RIGHT); case (keyboardNames.NUM_ZERO): return(Logitech_keyboardBitmapKeys.NUM_ZERO); case (keyboardNames.NUM_PERIOD): return(Logitech_keyboardBitmapKeys.NUM_PERIOD); default: return(Logitech_keyboardBitmapKeys.UNKNOWN); } }
public static bool LogiLedSetLightingForKeyWithKeyName(keyboardNames keyCode, Color color) { var(R, G, B) = GetColorValues(color); return(GHUB ? GHUBImports.LogiLedSetLightingForKeyWithKeyName(keyCode, R, G, B) : LGSImports.LogiLedSetLightingForKeyWithKeyName(keyCode, R, G, B)); }