Skip to content
Snippets Groups Projects
Commit c1a64c05 authored by George Nachman's avatar George Nachman
Browse files

Adhoc build 3.0.20161115_204208

parent 14d45e33
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6359,7 +6359,7 @@
DevelopmentTeam = H7V7XYVQ7D;
};
874206460564169600CFC3F1 = {
DevelopmentTeam = CMC4EL7UVS;
DevelopmentTeam = H7V7XYVQ7D;
};
A6C7603F1B45C4CF00E3C992 = {
DevelopmentTeam = H7V7XYVQ7D;
Loading
Loading
@@ -8060,7 +8060,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = CMC4EL7UVS;
DEVELOPMENT_TEAM = H7V7XYVQ7D;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
Loading
Loading
@@ -9206,7 +9206,7 @@
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = CMC4EL7UVS;
DEVELOPMENT_TEAM = H7V7XYVQ7D;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
Loading
Loading
@@ -9275,7 +9275,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = CMC4EL7UVS;
DEVELOPMENT_TEAM = H7V7XYVQ7D;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
Loading
Loading
@@ -9340,7 +9340,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = CMC4EL7UVS;
DEVELOPMENT_TEAM = H7V7XYVQ7D;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
Loading
Loading
#import <Cocoa/Cocoa.h>
 
#import "iTermModifierRemapper.h"
#import "DebugLogging.h"
#import "iTermApplicationDelegate.h"
#import "iTermHotKeyController.h"
#import "iTermKeyBindingMgr.h"
Loading
Loading
@@ -69,11 +69,11 @@
#pragma mark - Private
 
- (void)beginRemappingModifiers {
NSLog(@"Begin remapping modifiers");
ELog(@"Begin remapping modifiers");
[[iTermEventTap sharedInstance] setRemappingDelegate:self];
if (![[iTermEventTap sharedInstance] isEnabled]) {
NSLog(@"The event tap is NOT enabled");
ELog(@"The event tap is NOT enabled");
if (IsMavericksOrLater()) {
[self requestAccessibilityPermissionMavericks];
return;
Loading
Loading
@@ -101,7 +101,7 @@
}
 
- (void)requestAccessibilityPermissionMavericks {
NSLog(@"Requesting mavericks accessibility permission");
ELog(@"Requesting mavericks accessibility permission");
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSDictionary *options = @{ (NSString *)kAXTrustedCheckOptionPrompt: @YES };
Loading
Loading
@@ -125,14 +125,21 @@
#pragma mark - iTermEventTapRemappingDelegate
 
- (CGEventRef)remappedEventFromEventTappedWithType:(CGEventType)type event:(CGEventRef)event {
NSLog(@"Modifier remapper got an event");
ELog(@"Modifier remapper got an event");
if ([NSApp isActive]) {
NSLog(@"App is active, performing remapping");
ELog(@"App is active, performing remapping");
// Remap modifier keys only while iTerm2 is active; otherwise you could just use the
// OS's remap feature.
return [self eventByRemappingEvent:event];
} else {
NSLog(@"App not active");
ELog(@"App not active");
for (NSRunningApplication *currApp in [[NSWorkspace sharedWorkspace] runningApplications]) {
if ([currApp isActive]) {
ELog(@"This app is active: %@", [currApp localizedName]);
} else {
ELog(@"This app is not active: %@", [currApp localizedName]);
}
}
return event;
}
}
Loading
Loading
@@ -140,7 +147,7 @@
// Only called when the app is active.
- (CGEventRef)eventByRemappingEvent:(CGEventRef)event {
NSEvent *cocoaEvent = [NSEvent eventWithCGEvent:event];
NSLog(@"Remapping event %@", cocoaEvent);
ELog(@"Remapping event %@", cocoaEvent);
iTermShortcutInputView *shortcutView = nil;
NSResponder *firstResponder = [[NSApp keyWindow] firstResponder];
if ([firstResponder isKindOfClass:[iTermShortcutInputView class]]) {
Loading
Loading
@@ -148,7 +155,7 @@
}
 
if (shortcutView.disableKeyRemapping) {
NSLog(@"Shortcut view is active so return nil");
ELog(@"Shortcut view is active so return nil");
// Send keystroke directly to preference panel when setting do-not-remap for a key; for
// system keys, NSApp sendEvent: is never called so this is the last chance.
[shortcutView handleShortcutEvent:cocoaEvent];
Loading
Loading
@@ -157,17 +164,17 @@
 
switch ([self boundActionForEvent:cocoaEvent]) {
case KEY_ACTION_REMAP_LOCALLY:
NSLog(@"Calling sendEvent:");
ELog(@"Calling sendEvent:");
[iTermKeyBindingMgr remapModifiersInCGEvent:event];
[NSApp sendEvent:[NSEvent eventWithCGEvent:event]];
return nil;
 
case KEY_ACTION_DO_NOT_REMAP_MODIFIERS:
NSLog(@"Action is do not remap");
ELog(@"Action is do not remap");
return event;
 
default:
NSLog(@"Remapping as usual");
ELog(@"Remapping as usual");
[iTermKeyBindingMgr remapModifiersInCGEvent:event];
return event;
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment