- (void)HIDManager:(NJHIDManager *)manager deviceAdded:(IOHIDDeviceRef)device;
- (void)HIDManager:(NJHIDManager *)manager deviceRemoved:(IOHIDDeviceRef)device;
-- (void)HIDManager:(NJHIDManager *)manager
- valueChanged:(IOHIDValueRef)value
- fromDevice:(IOHIDDeviceRef)device;
+- (void)HIDManager:(NJHIDManager *)manager valueChanged:(IOHIDValueRef)value;
- (void)HIDManager:(NJHIDManager *)manager didError:(NSError *)error;
static void _input(void *ctx, IOReturn inResult, void *inSender, IOHIDValueRef value) {
NJHIDManager *self = (__bridge NJHIDManager *)ctx;
- IOHIDDeviceRef device = IOHIDQueueGetDevice(inSender);
- [self.delegate HIDManager:self valueChanged:value fromDevice:device];
+ [self.delegate HIDManager:self valueChanged:value];
}
static void _add(void *ctx, IOReturn inResult, void *inSender, IOHIDDeviceRef device) {
CVDisplayLinkStart(_displayLink);
}
-- (void)runOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+- (void)runOutputForValue:(IOHIDValueRef)value {
+ IOHIDElementRef elt = value ? IOHIDValueGetElement(value) : NULL;
+ IOHIDDeviceRef device = elt ? IOHIDElementGetDevice(elt) : NULL;
NJDevice *dev = [self findDeviceByRef:device];
NJInput *mainInput = [dev inputForEvent:value];
[mainInput notifyEvent:value];
}
}
-- (void)showOutputForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+- (void)showOutputForValue:(IOHIDValueRef)value {
+ IOHIDElementRef elt = value ? IOHIDValueGetElement(value) : NULL;
+ IOHIDDeviceRef device = elt ? IOHIDElementGetDevice(elt) : NULL;
NJDevice *dev = [self findDeviceByRef:device];
NJInput *handler = [dev handlerForEvent:value];
if (!handler)
[self.delegate inputController:self didInput:handler];
}
-- (void)HIDManager:(NJHIDManager *)manager
- valueChanged:(IOHIDValueRef)value
- fromDevice:(IOHIDDeviceRef)device {
- if (self.simulatingEvents
- && !NSApplication.sharedApplication.isActive) {
- [self runOutputForDevice:device value:value];
+- (void)HIDManager:(NJHIDManager *)manager valueChanged:(IOHIDValueRef)value {
+ if (self.simulatingEvents && !NSApplication.sharedApplication.isActive) {
+ [self runOutputForValue:value];
} else {
- [self showOutputForDevice:device value:value];
+ [self showOutputForValue:value];
}
}
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>636</string>
+ <string>647</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>NSHumanReadableCopyright</key>