LED Control

int libmk_set_effect(LibMK_Handle *handle, LibMK_Effect effect)

Set effect to be active on keyboard.

Return

LibMK_Result result code

Parameters
  • handle: LibMK_Handle for device to set effect on. If NULL uses global device handle

  • effect: LibMK_Effect specifier of effect to activate

int libmk_set_effect_details(LibMK_Handle *handle, LibMK_Effect_Details *effect)

Set effect to be active on keyboard with parameters.

Return

LibMK_Result result code

Parameters

int libmk_set_full_color(LibMK_Handle *handle, unsigned char r, unsigned char g, unsigned char b)

Set color of all the LEDs on the keyboard to a single color.

Return

LibMK_Result result code

Parameters
  • handle: LibMK_Handle for device to set color off. If NULL uses global device handle.

  • r: color byte red

  • g: color byte green

  • b: color byte blue

int libmk_set_all_led_color(LibMK_Handle *handle, unsigned char *colors)

Set the color of all the LEDs on the keyboard individually.

Return

LibMK_Result result code

Parameters
  • handle: LibMK_Handle for device to set the key colors on. If NULL uses the global device handle.

  • colors: Pointer to array of unsigned char of [LIBMK_MAX_ROWS][LIBMK_MAX_COLS][3] size.

int libmk_set_single_led(LibMK_Handle *handle, unsigned char row, unsigned char col, unsigned char r, unsigned char g, unsigned char b)

Set the color of a single LED on the keyboard.

Return

LibMK_Result result code

Parameters
  • handle: LibMK_Handle for device to set the color of the key on. If NULL uses the global device handle.

  • row: Zero-indexed row index

  • col: Zero-indexed column index

  • r: color byte red

  • g: color byte green

  • b: color byte blue

int libmk_get_offset(unsigned char *offset, LibMK_Handle *handle, unsigned char row, unsigned char col)

Retrieve the addressing offset of a specific key.

Return

LibMK_Result result code

Parameters
  • offset: Pointer to unsigned char to store offset in

  • handle: LibMK_Handle for the device to find the offset for. Is required in order to determine the layout of the device.

  • row: Zero-indexed row index

  • col: Zero-indexed column index