Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added initWithIdentifier:keyCombo for easier legacy adoption by PTHot…

…KeysLib users
  • Loading branch information...
commit 9469ca7a408fb60baa721309409dcbae5083de7a 1 parent 45192c2
@justin justin authored
Showing with 10 additions and 1 deletion.
  1. +1 −0  SGHotKeysLib/SGHotKey.h
  2. +9 −1 SGHotKeysLib/SGHotKey.m
View
1  SGHotKeysLib/SGHotKey.h
@@ -28,6 +28,7 @@
@property (nonatomic, assign) SEL action;
@property (nonatomic, assign) EventHotKeyID hotKeyID;
+- (id)initWithIdentifier:(id)theIdentifier keyCombo:(SGKeyCombo *)theCombo;
- (id)initWithIdentifier:(id)theIdentifier keyCombo:(SGKeyCombo *)theCombo target:(id)theTarget action:(SEL)theAction;
- (BOOL)matchesHotKeyID:(EventHotKeyID)theKeyID;
- (void)invoke;
View
10 SGHotKeysLib/SGHotKey.m
@@ -27,9 +27,17 @@ - (void)dealloc {
}
- (id)init {
- return [self initWithIdentifier:nil keyCombo:nil target:nil action:nil];
+ return [self initWithIdentifier:nil keyCombo:nil];
}
+- (id)initWithIdentifier:(id)theIdentifier keyCombo:(SGKeyCombo *)theCombo {
+ if (self = [super init]) {
+ self.identifier = theIdentifier;
+ self.keyCombo = theCombo;
+ }
+
+ return self;
+}
- (id)initWithIdentifier:(id)theIdentifier keyCombo:(SGKeyCombo *)theCombo target:(id)theTarget action:(SEL)theAction {
if (self = [super init]) {
self.identifier = theIdentifier;
Please sign in to comment.
Something went wrong with that request. Please try again.