diff options
| author | Jason Perkins | 2015-02-16 10:22:22 -0500 | 
|---|---|---|
| committer | Jason Perkins | 2015-02-16 10:22:22 -0500 | 
| commit | e2b2d5b9e15cd5c8341202e48f2d63c39963b591 (patch) | |
| tree | 98d95353e4d92890d13f15bc316941857141970d | |
| parent | 86d5b1ae49105c1b0a789cbdac17dd7ce0da0479 (diff) | |
| download | MASShortcut-e2b2d5b9e15cd5c8341202e48f2d63c39963b591.tar.bz2 | |
Allow first responder support to be turned on and off
| -rw-r--r-- | Framework/MASShortcutView.h | 2 | ||||
| -rw-r--r-- | Framework/MASShortcutView.m | 9 | 
2 files changed, 10 insertions, 1 deletions
| diff --git a/Framework/MASShortcutView.h b/Framework/MASShortcutView.h index 166be44..656f4e4 100644 --- a/Framework/MASShortcutView.h +++ b/Framework/MASShortcutView.h @@ -21,4 +21,6 @@ typedef enum {  /// Returns custom class for drawing control.  + (Class)shortcutCellClass; +- (void)setAcceptsFirstResponder:(BOOL)value; +  @end diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index 4132ce2..d96989c 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -24,6 +24,7 @@ NSString *const MASShortcutBinding = @"shortcutValue";      NSInteger _shortcutToolTipTag;      NSInteger _hintToolTipTag;      NSTrackingArea *_hintArea; +	BOOL _acceptsFirstResponder;  }  #pragma mark - @@ -59,6 +60,7 @@ NSString *const MASShortcutBinding = @"shortcutValue";      _shortcutValidator = [MASShortcutValidator sharedValidator];      _enabled = YES;      _showsDeleteButton = YES; +	_acceptsFirstResponder = NO;      [self resetShortcutCellStyle];  } @@ -565,7 +567,12 @@ void *kUserDataHint = &kUserDataHint;  - (BOOL)acceptsFirstResponder  { -    return YES; +	return _acceptsFirstResponder; +} + +- (void)setAcceptsFirstResponder:(BOOL)value +{ +	_acceptsFirstResponder = value;  }  - (BOOL)becomeFirstResponder | 
