Skip to content

Commit

Permalink
Add action to mapping if new keycode is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
iKenndac committed Apr 25, 2014
1 parent aa3c96c commit 8d2922c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DKCECKeyMappingController.m
Expand Up @@ -7,6 +7,7 @@
//

#import "DKCECKeyMappingController.h"
#import "DKDoNothingLocalAction.h"
#import "Constants.h"

static NSString * const kBaseMappingUserDefaultsKey = @"BaseMapping";
Expand Down Expand Up @@ -203,7 +204,12 @@ -(NSDictionary *)propertyListRepresentation {
if ([potentialAction matchesKeyPress:keypress])
return potentialAction;
}
return nil;

// If we get here, there's no action for the given keypress. Maybe
// the user messed around with the plist, or we added new keycodes.
DKLocalAction *action = [[DKDoNothingLocalAction alloc] initWithDeviceKeyCode:keypress.keycode];
[self addAction:action];
return action;
}

-(void)addAction:(id <DKLocalAction>)action {
Expand Down

0 comments on commit 8d2922c

Please sign in to comment.