diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
commit | fb8e9903a323acaf5fc78819bb3c203567542ab2 (patch) | |
tree | e40665103ac7db492e0a40e34cd92f3390defa55 /SmartDeviceLink/SDLOnKeyboardInput.m | |
parent | f7540a02262832e34c67b0953dd8a1804a046fea (diff) | |
download | sdl_ios-fb8e9903a323acaf5fc78819bb3c203567542ab2.tar.gz |
Shift files into root directory
Diffstat (limited to 'SmartDeviceLink/SDLOnKeyboardInput.m')
-rw-r--r-- | SmartDeviceLink/SDLOnKeyboardInput.m | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLOnKeyboardInput.m b/SmartDeviceLink/SDLOnKeyboardInput.m new file mode 100644 index 000000000..a70a7d06c --- /dev/null +++ b/SmartDeviceLink/SDLOnKeyboardInput.m @@ -0,0 +1,53 @@ +// SDLOnKeyboardInput.m +// + +#import "SDLOnKeyboardInput.h" + +#import "SDLKeyboardEvent.h" +#import "SDLNames.h" + + +@implementation SDLOnKeyboardInput + +- (instancetype)init { + if (self = [super initWithName:NAMES_OnKeyboardInput]) { + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + if (self = [super initWithDictionary:dict]) { + } + return self; +} + +- (void)setEvent:(SDLKeyboardEvent *)event { + if (event != nil) { + [parameters setObject:event forKey:NAMES_event]; + } else { + [parameters removeObjectForKey:NAMES_event]; + } +} + +- (SDLKeyboardEvent *)event { + NSObject *obj = [parameters objectForKey:NAMES_event]; + if (obj == nil || [obj isKindOfClass:SDLKeyboardEvent.class]) { + return (SDLKeyboardEvent *)obj; + } else { + return [SDLKeyboardEvent valueOf:(NSString *)obj]; + } +} + +- (void)setData:(NSString *)data { + if (data != nil) { + [parameters setObject:data forKey:NAMES_data]; + } else { + [parameters removeObjectForKey:NAMES_data]; + } +} + +- (NSString *)data { + return [parameters objectForKey:NAMES_data]; +} + +@end |