Skip to content

Commit

Permalink
The shortcuts "Discoverability" menu shown while pressing Cmd will no…
Browse files Browse the repository at this point in the history
…t be shown if Cmd is assigned any modifer mappings in keyboard screen
  • Loading branch information
atul3189 committed Jan 17, 2017
1 parent 1a35528 commit 09301e4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Blink/SpaceController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#import "SmartKeysController.h"
#import "TermController.h"
#import "ScreenController.h"

#import "BKDefaults.h"

@interface SpaceController () <UIPageViewControllerDataSource, UIPageViewControllerDelegate,
UIGestureRecognizerDelegate, TermControlDelegate>
Expand All @@ -57,6 +57,7 @@ @implementation SpaceController {
MBProgressHUD *_hud;

NSMutableArray<UIKeyCommand *> *_kbdCommands;
NSMutableArray<UIKeyCommand *> *_kbdCommandsWithoutDiscoverability;
}

#pragma mark Setup
Expand Down Expand Up @@ -437,6 +438,10 @@ - (void)terminalHangup:(TermController *)control

- (NSArray<UIKeyCommand *> *)keyCommands
{
NSMutableDictionary *kbMapping = [NSMutableDictionary dictionaryWithDictionary:[BKDefaults keyboardMapping]];
if([kbMapping objectForKey:@"⌘ Cmd"] && ![[kbMapping objectForKey:@"⌘ Cmd"]isEqualToString:@"None"]){
return _kbdCommandsWithoutDiscoverability;
}
return _kbdCommands;
}

Expand Down Expand Up @@ -478,6 +483,13 @@ - (void)setKbdCommands

[_kbdCommands addObject:cmd];
}

for (UIKeyCommand *command in _kbdCommands) {
UIKeyCommand *commandWithoutDiscoverability = [command copy];
commandWithoutDiscoverability.discoverabilityTitle = nil;
[_kbdCommandsWithoutDiscoverability addObject:commandWithoutDiscoverability];
}

}

- (void)otherScreen:(UIKeyCommand *)cmd
Expand Down

0 comments on commit 09301e4

Please sign in to comment.