You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
827 B
45 lines
827 B
9 years ago
|
//
|
||
|
// SRKeyEquivalentModifierMaskTransformer.m
|
||
|
// ShortcutRecorder
|
||
|
//
|
||
|
// Copyright 2012 Contributors. All rights reserved.
|
||
|
//
|
||
|
// License: BSD
|
||
|
//
|
||
|
// Contributors:
|
||
|
// Ilya Kulakov
|
||
|
|
||
|
#import "SRKeyEquivalentModifierMaskTransformer.h"
|
||
|
#import "SRKeyCodeTransformer.h"
|
||
|
#import "SRRecorderControl.h"
|
||
|
|
||
|
|
||
|
@implementation SRKeyEquivalentModifierMaskTransformer
|
||
|
|
||
|
#pragma mark NSValueTransformer
|
||
|
|
||
|
+ (BOOL)allowsReverseTransformation
|
||
|
{
|
||
|
return NO;
|
||
|
}
|
||
|
|
||
|
+ (Class)transformedValueClass
|
||
|
{
|
||
|
return [NSNumber class];
|
||
|
}
|
||
|
|
||
|
- (NSNumber *)transformedValue:(NSDictionary *)aValue
|
||
|
{
|
||
|
if (![aValue isKindOfClass:[NSDictionary class]])
|
||
|
return @(0);
|
||
|
|
||
|
NSNumber *modifierFlags = aValue[SRShortcutModifierFlagsKey];
|
||
|
|
||
|
if (![modifierFlags isKindOfClass:[NSNumber class]])
|
||
|
return @(0);
|
||
|
|
||
|
return modifierFlags;
|
||
|
}
|
||
|
|
||
|
@end
|