usb_hid: do not publish a keyboard device when a mouse is connected

My trackball has a "system control" in its descriptor, but is
definitely not a keyboard. This results in an extra entry in Input
preferences for it.

If we actually want to accept input from such devices, we should scan
them more closely to check there is actually a valid input there, and
consider publishing them as something else than keyboards, because
that's not really suitable in Input preferences.

Change-Id: I9027454b3b24d0f39ea562aed851402d0be7aeb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2715
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Adrien Destugues 2020-05-16 21:10:14 +02:00 committed by waddlesplash
parent 47bf2e3878
commit c12c97a6f1

View File

@ -188,7 +188,13 @@ KeyboardProtocolHandler::AddHandlers(HIDDevice &device,
switch (collection.UsageID()) {
case B_HID_UID_GD_KEYBOARD:
case B_HID_UID_GD_KEYPAD:
#if 0
// This is not specific enough to deserve a keyboard device on
// its own (some mice have one such descriptor, for example).
// If your keyboard uses this, do a more extensive check of
// the descriptor to make sure there actually are keys in it.
case B_HID_UID_GD_SYSTEM_CONTROL:
#endif
handled = true;
}