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 handleeffect
: 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
handle
: LibMK_Handle for device to set effect on. If NULL uses global device handle.effect
: LibMK_Effect_Details instance with all parameters set
-
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 redg
: color byte greenb
: 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 indexcol
: Zero-indexed column indexr
: color byte redg
: color byte greenb
: 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 inhandle
: 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 indexcol
: Zero-indexed column index