+// Set Boot Keyboard Protocol
+void Output_kbdProtocolBoot_capability( uint8_t state, uint8_t stateType, uint8_t *args )
+{
+ // Display capability name
+ if ( stateType == 0xFF && state == 0xFF )
+ {
+ print("Output_kbdProtocolBoot()");
+ return;
+ }
+
+ // Only set if necessary
+ if ( USBKeys_Protocol == 0 )
+ return;
+
+ // TODO Analog inputs
+ // Only set on key press
+ if ( stateType != 0x01 )
+ return;
+
+ // Flush the key buffers
+ Output_flushBuffers();
+
+ // Set the keyboard protocol to Boot Mode
+ USBKeys_Protocol = 0;
+}
+
+
+// Set NKRO Keyboard Protocol
+void Output_kbdProtocolNKRO_capability( uint8_t state, uint8_t stateType, uint8_t *args )
+{
+ // Display capability name
+ if ( stateType == 0xFF && state == 0xFF )
+ {
+ print("Output_kbdProtocolNKRO()");
+ return;
+ }
+
+ // Only set if necessary
+ if ( USBKeys_Protocol == 1 )
+ return;
+
+ // TODO Analog inputs
+ // Only set on key press
+ if ( stateType != 0x01 )
+ return;
+
+ // Flush the key buffers
+ Output_flushBuffers();
+
+ // Set the keyboard protocol to NKRO Mode
+ USBKeys_Protocol = 1;
+}
+
+