App delegate now controls communication between device / mapping controllers and...
[enjoyable.git] / Classes / NJOutputController.m
index 5235837..1567fee 100644 (file)
@@ -20,7 +20,9 @@
 #import "NJOutputMouseMove.h"
 #import "NJOutputMouseScroll.h"
 
-@implementation NJOutputController
+@implementation NJOutputController {
+    NJInput *_input;
+}
 
 - (id)init {
     if ((self = [super init])) {
 }
 
 - (NJOutput *)currentOutput {
-    return mappingsController.currentMapping[inputController.selectedInput];
+    return mappingsController.currentMapping[_input];
 }
 
 - (NJOutput *)makeOutput {
 
 - (void)commit {
     [self cleanUpInterface];
-    mappingsController.currentMapping[inputController.selectedInput] = [self makeOutput];
+    mappingsController.currentMapping[_input] = [self makeOutput];
     [mappingsController save];
 }
 
     [self cleanUpInterface];
 }
 
-- (void)loadCurrent {
-    [self loadOutput:self.currentOutput forInput:inputController.selectedInput];
+- (void)loadInput:(NJInput *)input {
+    _input = input;
+    [self loadOutput:self.currentOutput forInput:input];
 }
 
 - (void)focusKey {
 }
 
 - (void)mappingDidChange:(NSNotification *)note {
-    [self loadCurrent];
+    [self loadInput:_input];
 }
 
 @end