-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathG15Key.m
More file actions
39 lines (33 loc) · 739 Bytes
/
G15Key.m
File metadata and controls
39 lines (33 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// G15Key.m
// G15 Tools
//
// Created by Phillip Hutchings on 14/11/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "G15Key.h"
@implementation G15Key
@synthesize keyLabel, keyCode;
@dynamic keyOrder;
- (id)initWithCode:(int)code label:(NSString *)label {
if ((self = [super init]) != nil) {
keyCode = code;
keyLabel = [label copy];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)c {
[c encodeInt:keyCode forKey:@"code"];
[c encodeObject:keyLabel forKey:@"label"];
}
- (int)keyOrder {
return keyCode;
}
- (id)initWithCoder:(NSCoder *)c {
if ((self = [super init]) != nil) {
keyLabel = [c decodeObjectForKey:@"label"];
keyCode = [c decodeIntForKey:@"code"];
}
return self;
}
@end