]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Output/pjrcUSB/output_com.c
Merge pull request #120 from jlsalvador/feature-toggle-keyboard-protocol
[kiibohd-controller.git] / Output / pjrcUSB / output_com.c
index 082c42bc0b47722b6d509dee7222053c19db4206..6a9e64d6578bba87c4be32f8b850614300d31228 100644 (file)
@@ -218,6 +218,28 @@ void Output_kbdProtocolNKRO_capability( uint8_t state, uint8_t stateType, uint8_
 }
 
 
+// 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 )
 {