Skip to content
Permalink
Browse files

Fixed a bug that prevented the use of osx-hid with a specific URI

  • Loading branch information...
nroussel committed May 24, 2017
1 parent b0cf4a8 commit e1b51bf165a03e4c6009b9feff464da695252867
Showing with 9 additions and 0 deletions.
  1. +2 −0 pointing/input/osx/osxHIDInputDevice.cpp
  2. +7 −0 pointing/input/osx/osxHIDPointingDevice.cpp
@@ -61,6 +61,8 @@ namespace pointing {

URI devUri = hidDeviceURI(device) ;

// std::cerr << std::endl << self->uri.asString() << std::endl << devUri.asString() << std::endl << std::endl ;

bool match = self->theDevice==0 && (self->uri.isEmpty() || self->uri.scheme=="any" || self->uri.resemble(devUri)) ;
if (self->debugLevel>0) {
std::cerr << (match?"+ ":" ") ;
@@ -53,13 +53,20 @@ namespace pointing {
URI::getQueryArg(uri.query, "product", &productID) ;
URI::getQueryArg(uri.query, "usagePage", &primaryUsagePage) ;
URI::getQueryArg(uri.query, "usage", &primaryUsage) ;

if (uri.scheme=="osxhid-legacy")
uri.scheme = "osxhid" ; // FIXME: otherwise, won't match in osxHIDInputDevice (might want to fix this)

if (vendorID || productID)
uri.scheme = "any" ; // FIXME: otherwise, won't match in osxHIDInputDevice (might want to fix this)

std::string plist = hidDeviceFromVendorProductUsagePageUsage(vendorID, productID,
primaryUsagePage, primaryUsage) ;
hiddev = new osxHIDInputDevice(uri, plist.c_str()) ;

if (hiddev->debugLevel)
std::cerr << "osxHIDInputDevice: hiddev created" << std::endl ;

callback = 0 ;
callback_context = 0 ;
#if FORCE_QUEUE_MODE

0 comments on commit e1b51bf

Please sign in to comment.
You can’t perform that action at this time.