Mercurial > louis > kiibohd-controller
diff Output/usbMuxUart/output_com.c @ 445:380e1f0123d0
Adding toggleKbdProtocol capability
author | José Luis Salvador Rufo <salvador.joseluis@gmail.com> |
---|---|
date | Thu, 26 May 2016 13:06:12 +0200 |
parents | 68e19d7c953e |
children | 56237ba5da6f |
line wrap: on
line diff
--- a/Output/usbMuxUart/output_com.c Mon May 23 17:19:21 2016 -0700 +++ b/Output/usbMuxUart/output_com.c Thu May 26 13:06:12 2016 +0200 @@ -222,6 +222,28 @@ } +// Toggle Keyboard Protocol +void Output_toggleKbdProtocol_capability( uint8_t state, uint8_t stateType, uint8_t *args ) +{ + // Display capability name + if ( stateType == 0xFF && state == 0xFF ) + { + print("Output_toggleKbdProtocol()"); + return; + } + + // Only toggle protocol if release state + if ( stateType == 0x00 && state == 0x03 ) + { + // Flush the key buffers + Output_flushBuffers(); + + // Toggle the keyboard protocol Mode + USBKeys_Protocol = !USBKeys_Protocol; + } +} + + // Sends a Consumer Control code to the USB Output buffer void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args ) {