Control¶
-
int
libmk_enable_control
(LibMK_Handle *handle)¶ Initialize the keyboard for control and send control packet.
Must be called in order to be able to control the keyboard. Claims the LED interface on the keyboard USB controller with the appropriate endpoints for control.
- Return
LibMK_Result result code
- Parameters
handle
: LibMK_Handle* for the device to control. If NULL, the global handle is used.
-
int
libmk_disable_control
(LibMK_Handle *handle)¶ Release the keyboard from control.
Must be called when the user is done controlling the keyboard. Support for re-enabling of control on the same
LibMK_Handle is not guaranteed.- Return
LibMK_Result result code
- Parameters
handle
: LibMK_Handle* for the device to release. If NULL, the global handle is used.
-
int
libmk_claim_interface
(LibMK_Handle *handle)¶ Internal function. Claims USB LED interface on device.
-
int
libmk_send_control_packet
(LibMK_Handle *handle)¶ Sends packet to put the keyboard in LIBMK_EFFECT_CTRL.
- Return
LibMK_Result result code
- Parameters
handle
: LibMK_Handle* for the device to send the packet to. If NULL, the global handle is used.
-
int
libmk_reset
(LibMK_Handle *handle)¶ Internal function. Reset the libusb interface when releasing.