USB HID: Changed/removed wrong comment.
* The HID driver publishes devices for all handlers that claim to know how to work with a device. I see how that is good for a combo device like keyboard with built-in touch pad or a single USB receiver for a keyboard and mouse. But I wonder about devices that publish multiple alternative HID configurations. I think my Wacom Tablet has a configuration for a regular mouse and the configuration for the actual tablet. And the driver should publish a device for one, but not the other. I also don't see in the code how a specific configuration is made the active one before the protocol is used.
This commit is contained in:
@@ -77,7 +77,6 @@ ProtocolHandler::AddHandlers(HIDDevice &device, ProtocolHandler *&handlerList,
|
|||||||
TRACE("root collection holds %lu application collection%s\n",
|
TRACE("root collection holds %lu application collection%s\n",
|
||||||
appCollectionCount, appCollectionCount != 1 ? "s" : "");
|
appCollectionCount, appCollectionCount != 1 ? "s" : "");
|
||||||
|
|
||||||
handlerCount = 0;
|
|
||||||
for (uint32 i = 0; i < appCollectionCount; i++) {
|
for (uint32 i = 0; i < appCollectionCount; i++) {
|
||||||
HIDCollection *collection = rootCollection->ChildAtFlat(
|
HIDCollection *collection = rootCollection->ChildAtFlat(
|
||||||
COLLECTION_APPLICATION, i);
|
COLLECTION_APPLICATION, i);
|
||||||
@@ -87,21 +86,19 @@ ProtocolHandler::AddHandlers(HIDDevice &device, ProtocolHandler *&handlerList,
|
|||||||
TRACE("collection usage page %u usage id %u\n",
|
TRACE("collection usage page %u usage id %u\n",
|
||||||
collection->UsagePage(), collection->UsageID());
|
collection->UsagePage(), collection->UsageID());
|
||||||
|
|
||||||
// NOTE: There isn't currently a mechanism in place that figures out the
|
// NOTE: The driver publishes devices for all added handlers.
|
||||||
// "best" handler for a device. Consider the case of a tablet input
|
|
||||||
// device: It might advertise itself as regular mouse in one descriptor.
|
// TODO: How does this work if a device is not a compound device
|
||||||
// If the MouseProtocolHandler is given a chance to look at the device
|
// like a keyboard with built-in touchpad, but allows multiple
|
||||||
// first, it might be happy with that descriptor and provide the
|
// alternative configurations like a tablet that works as either
|
||||||
// protocol handler. That is why the TabletProtocolHandler and
|
// regular (relative) mouse, or (absolute) tablet?
|
||||||
// JostickProtocolHandlers are given a chance first, so they might look
|
|
||||||
// for more interesting descriptors that unlock the specific device
|
|
||||||
// functions best.
|
|
||||||
KeyboardProtocolHandler::AddHandlers(device, *collection, handlerList);
|
KeyboardProtocolHandler::AddHandlers(device, *collection, handlerList);
|
||||||
JoystickProtocolHandler::AddHandlers(device, *collection, handlerList);
|
JoystickProtocolHandler::AddHandlers(device, *collection, handlerList);
|
||||||
TabletProtocolHandler::AddHandlers(device, *collection, handlerList);
|
TabletProtocolHandler::AddHandlers(device, *collection, handlerList);
|
||||||
MouseProtocolHandler::AddHandlers(device, *collection, handlerList);
|
MouseProtocolHandler::AddHandlers(device, *collection, handlerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handlerCount = 0;
|
||||||
ProtocolHandler *handler = handlerList;
|
ProtocolHandler *handler = handlerList;
|
||||||
while (handler != NULL) {
|
while (handler != NULL) {
|
||||||
handler = handler->NextHandler();
|
handler = handler->NextHandler();
|
||||||
|
|||||||
Reference in New Issue
Block a user