PaulStoffregen / USBHost_t36

USB Host Library for Teensy 3.6 and 4.0
167 stars 86 forks source link

Now only optionally force keyboard into boot protocol mode #23

Closed KurtE closed 5 years ago

KurtE commented 5 years ago

The first gigabyte fix, was to always force the keyboard into boot protocol mode, which appeared to work well for all of the keyboards I tried.

Unforationally it caused issues with some wireless keyboard/mouse combo packages, including some logitech and some microsoft keyboards.

This version instead, I created a list (currently only one vendor id), of vendor id:product id, that need to be forced into boot mode. Knowing that if there is one keyboard vendor with this N key rollover feature, there are probably others. So while this list can be expanded, this requires users to update library. So added a method forceBootProtocol method to keyboard class that allows the user to try it out without needing to update the library sources.

The mouse test program has example of either setting it before the keyboard is initiated, as well as another way that when a connection is found it asks for the vendor id, and if it is the one of my gigabyte keyboard, it calls the function then.

While doing this I found some of the query functions like idVendor on the keyboard class would not compile as the keyboard object has multiple inheritence and both base classes have this. So like the joystick objects I added these to the top level function and these functions will direct the calls to the approrpriate places.

KurtE commented 5 years ago

Note: This is hopefully to fix the issues in the forum thread: https://forum.pjrc.com/threads/54186-USB-Host-wireless-mouse-not-working-keyboard-ok

Without hopefully breaking the gigabyte fix