-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITHotKey.m
61 lines (47 loc) · 918 Bytes
/
ITHotKey.m
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#import "ITHotKey.h"
#import "ITKeyCombo.h"
@implementation ITHotKey
- (id)init {
if ((self = [super init])) {
[self setKeyCombo:[ITKeyCombo clearKeyCombo]];
}
return self;
}
- (void)dealloc {
[mName release];
[mKeyCombo release];
[super dealloc];
}
- (NSString *)description {
return [NSString stringWithFormat:@"<%@: %@>", NSStringFromClass([self class]), [self keyCombo]];
}
- (void)setKeyCombo:(ITKeyCombo *)combo {
[mKeyCombo autorelease];
mKeyCombo = [combo retain];
}
- (ITKeyCombo *)keyCombo {
return mKeyCombo;
}
- (void)setName:(NSString *)name {
[mName autorelease];
mName = [name retain];
}
- (NSString *)name {
return mName;
}
- (void)setTarget:(id)target {
mTarget = target;
}
- (id)target {
return mTarget;
}
- (void)setAction:(SEL)action {
mAction = action;
}
- (SEL)action {
return mAction;
}
- (void)invoke {
[mTarget performSelector:mAction withObject:self];
}
@end