diff --git a/Readme.md b/Readme.md index 68c392a..3fcddc2 100644 --- a/Readme.md +++ b/Readme.md @@ -12,10 +12,12 @@ The idea is to enable enhanced USB functions to almost all 'standard' Arduino bo * Mega (with HoodLoader2) * Leonardo * (Pro)Micro -* Any other 8u2/16u/at90usb162/32u2/32u4 compatible board +* Any other 8u2/16u2/at90usb8/162/32u2/32u4 compatible board **Supported HID devices:** * Keyboard with Leds out (modifiers + 6 keys pressed at the same time) +* Teensy Keyboard with different keyboard layouts (german, french and many more) +* BootKeyboard protocol for Improved/Teensy Keyboard (works under BIOS) * NKRO Keyboard with Leds out (press up to 113 keys at the same time) * Mouse (5 buttons, move, wheel) * Absolute Mouse @@ -88,6 +90,7 @@ Version History * Added HID out report in general (RAW HID preparation) * Added a few key definitions * Uses .alinkage custom IDE option +* Added BootKeyboard support (BIOS compatibility) 2.3 Release (never released) * Updated Libraries diff --git a/src/HID-Project.h b/src/HID-Project.h index ad8882f..ffce021 100644 --- a/src/HID-Project.h +++ b/src/HID-Project.h @@ -34,7 +34,7 @@ THE SOFTWARE. #endif #define HID_KEYBOARD_LEDS_ENABLED -//#define USE_BOOT_KEYBOARD_PROTOCOL +#define USE_BOOT_KEYBOARD_PROTOCOL //#define LAYOUT_US_ENGLISH //#define LAYOUT_CANADIAN_FRENCH diff --git a/src/ImprovedKeyboard.cpp b/src/ImprovedKeyboard.cpp index 1f1019a..146818d 100644 --- a/src/ImprovedKeyboard.cpp +++ b/src/ImprovedKeyboard.cpp @@ -102,10 +102,12 @@ void Keyboard_::sendReport(HID_KeyboardReport_Data_t* keys) // Call the inherited function. // This wrapper still saves us some bytes #if defined(USE_BOOT_KEYBOARD_PROTOCOL) - HID.SendReport(HID_REPORTID_NONE, keys,sizeof(HID_KeyboardReport_Data_t)); -#else - SendReport(keys,sizeof(HID_KeyboardReport_Data_t)); + if(getProtocol() != 1){ + SendRawReport(keys,sizeof(HID_KeyboardReport_Data_t)); + } + else #endif + SendReport(keys,sizeof(HID_KeyboardReport_Data_t)); } #if defined(HID_KEYBOARD_LEDS_ENABLED) diff --git a/src/PluggableHID/HIDDevice.cpp b/src/PluggableHID/HIDDevice.cpp index d697f40..97b5c83 100644 --- a/src/PluggableHID/HIDDevice.cpp +++ b/src/PluggableHID/HIDDevice.cpp @@ -2,10 +2,7 @@ #include "PluggableUSB.h" #include "HIDDevice.h" #include "HID.h" - -#ifdef kkk -#error -#endif +#include "HID-Project.h" #if defined(USBCON) @@ -19,6 +16,10 @@ void HIDDevice::SendReport(const void* data, int len){ HID.SendReport(reportID, data, len); } +void HIDDevice::SendRawReport(const void* data, int len){ + HID.SendReport(HID_REPORTID_NONE, data, len); +} + void HIDDevice::setReportData(const void* data, int len){ // Discard this information if its not implemented by the HIDDevice } diff --git a/src/PluggableHID/HIDDevice.h b/src/PluggableHID/HIDDevice.h index ef2fcf5..1ec3495 100644 --- a/src/PluggableHID/HIDDevice.h +++ b/src/PluggableHID/HIDDevice.h @@ -55,6 +55,7 @@ protected: // Could be used and inherited public for custom, professional usage, like raw Keyboard // As an alternative you may still call the HID singleton. void SendReport(const void* data, int len); + void SendRawReport(const void* data, int len); uint8_t getProtocol(void); }; diff --git a/src/TeensyKeyboard.cpp b/src/TeensyKeyboard.cpp index 25855fa..10f36a3 100644 --- a/src/TeensyKeyboard.cpp +++ b/src/TeensyKeyboard.cpp @@ -254,10 +254,12 @@ void usb_keyboard_class::set_media(uint8_t c) void usb_keyboard_class::send_now(void) { #if defined(USE_BOOT_KEYBOARD_PROTOCOL) - HID.SendReport(HID_REPORTID_NONE, keyboard_report_data,sizeof(keyboard_report_data)); -#else - SendReport(keyboard_report_data,sizeof(keyboard_report_data)); + if(getProtocol() != 1){ + SendRawReport(keyboard_report_data,sizeof(keyboard_report_data)); + } + else #endif + SendReport(keyboard_report_data,sizeof(keyboard_report_data)); }