Archived
1
0

Adding toggleKbdProtocol capability

This commit is contained in:
José Luis Salvador Rufo 2016-05-26 13:06:12 +02:00
parent caa01dbf50
commit 0174e1e6ab
No known key found for this signature in database
GPG Key ID: EB6088EDBB1F1D99
3 changed files with 45 additions and 0 deletions

View File

@ -17,6 +17,7 @@ mouseOut => Output_usbMouse_capability( mouseCode : 2, relative_x : 2, relati
# Configuration capabilities
kbdProtocolBoot => Output_kbdProtocolBoot_capability();
kbdProtocolNKRO => Output_kbdProtocolNKRO_capability();
toggleKbdProtocol => Output_toggleKbdProtocol_capability();
# Locale Settings
keyboardLocale => KeyboardLocale_define;

View 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 )
{

View File

@ -222,6 +222,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 )
{