Mercurial > louis > kiibohd-controller
comparison Output/pjrcUSB/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 |
comparison
equal
deleted
inserted
replaced
444:a6370d67f460 | 445:380e1f0123d0 |
---|---|
216 // Set the keyboard protocol to NKRO Mode | 216 // Set the keyboard protocol to NKRO Mode |
217 USBKeys_Protocol = 1; | 217 USBKeys_Protocol = 1; |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 // Toggle Keyboard Protocol | |
222 void Output_toggleKbdProtocol_capability( uint8_t state, uint8_t stateType, uint8_t *args ) | |
223 { | |
224 // Display capability name | |
225 if ( stateType == 0xFF && state == 0xFF ) | |
226 { | |
227 print("Output_toggleKbdProtocol()"); | |
228 return; | |
229 } | |
230 | |
231 // Only toggle protocol if release state | |
232 if ( stateType == 0x00 && state == 0x03 ) | |
233 { | |
234 // Flush the key buffers | |
235 Output_flushBuffers(); | |
236 | |
237 // Toggle the keyboard protocol Mode | |
238 USBKeys_Protocol = !USBKeys_Protocol; | |
239 } | |
240 } | |
241 | |
242 | |
221 // Sends a Consumer Control code to the USB Output buffer | 243 // Sends a Consumer Control code to the USB Output buffer |
222 void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args ) | 244 void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args ) |
223 { | 245 { |
224 // Display capability name | 246 // Display capability name |
225 if ( stateType == 0xFF && state == 0xFF ) | 247 if ( stateType == 0xFF && state == 0xFF ) |