macOS input: Only parse guids for BLUETOOTH and USB transport types.
@@ -318,9 +318,9 @@ class HIDDevice:
if self.transport == 'USB':
bustype = 0x03
- vendor = self.vendorID
- product = self.productID
- version = self.versionNumber
+ vendor = self.vendorID or 0
+ product = self.productID or 0
+ version = self.versionNumber or 0
# Byte swap (ABCD --> CDAB):
bustype = ((bustype << 8) | (bustype >> 8)) & 0xFFFF
vendor = ((vendor << 8) | (vendor >> 8)) & 0xFFFF
@@ -726,6 +726,7 @@ def get_apple_remote(display=None):
def _create_controller(device, display):
+ if device.transport in ('USB', 'BLUETOOTH'):
mapping = get_mapping(device.get_guid())
if not mapping:
return
