Skip to content

Commit

Permalink
Merge pull request #15 from ZeR0-Wu/master
Browse files Browse the repository at this point in the history
enable ⌘+ ⇧ + T shortcut to reopen last closed tab
  • Loading branch information
Olivier Poitrey committed Aug 5, 2014
2 parents ae136e4 + d9b4225 commit 9e0a311
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions SafariTabSwitching/SafariTabSwitching.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ - (void)SafariTabeSwitching_sendEvent:(NSEvent *)event
return; // prevent event dispatching
}
}

}
else if (event.type == NSKeyDown
&& (event.modifierFlags & NSDeviceIndependentModifierFlagsMask) == (NSCommandKeyMask|NSShiftKeyMask) && event.keyCode == 0x11) { // keycode of 'T'

CGEventRef e = CGEventCreateKeyboardEvent(NULL, 0x6, YES); // keycode of 'Z'

CGEventSetFlags(e, kCGEventFlagMaskCommand);

NSEvent *new_event = [NSEvent eventWithCGEvent:e];

CFRelease(e);

[self SafariTabeSwitching_sendEvent:new_event];

return;
}

[self SafariTabeSwitching_sendEvent:event];
Expand Down

0 comments on commit 9e0a311

Please sign in to comment.