#import "JSAction.h"
#import "Target.h"
#import "TargetController.h"
+#import "NJEvents.h"
@implementation JoystickController {
IOHIDManagerRef hidManager;
JoystickController *controller = (__bridge JoystickController *)ctx;
IOHIDDeviceRef device = IOHIDQueueGetDevice(inSender);
- if (controller.sendingRealEvents) {
+ if (controller.translatingEvents) {
[controller runTargetForDevice:device value:value];
} else if ([NSApplication sharedApplication].mainWindow.isVisible) {
[controller showTargetForDevice:device value:value];
}
- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
+
[targetController loadCurrent];
}
+- (void)setTranslatingEvents:(BOOL)translatingEvents {
+ if (translatingEvents != _translatingEvents) {
+ _translatingEvents = translatingEvents;
+ NSString *name = translatingEvents
+ ? NJEventTranslationActivated
+ : NJEventTranslationDeactivated;
+ [NSNotificationCenter.defaultCenter postNotificationName:name
+ object:self];
+ }
+}
+
@end