Skip to content

Commit

Permalink
Remove Cmd-Shift-T Shortcut
Browse files Browse the repository at this point in the history
Because:

- Users who wish to remap Cmd-Shift-T to Safari's "Undo Close Tab" menu item
  (providing equivalent, single-tab-reopen functionality) may do so by simply
  assigning a keyboard shortcut in System Preferences -> Keyboard -> Shortcuts

And because:

- There are other Safari extensions (like Antrikshy/RecoverTabs) which provide
  more comprehensive support for Cmd-Shift-T tab-reopening, including the
  ability to reopen more than one tab
- This extension's remapping of Cmd-Shift-T breaks other in-browser Safari
  plugins that attempt to use Cmd-Shift-T

This commit:

- Reverts rs#15 and removes support for reopening tabs using Cmd-Shift-T.
  • Loading branch information
reshleman committed Oct 17, 2014
1 parent e4e16cd commit e647aec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ Usage
Use the command + <num> keyboard shortcut to switch between the 9 first tabs of your Safari windows.

NOTE: This plugin replaces the default behavior of those hotkeys which is to open the 9 first Bookmark Bar links.

As a bonus, this plugin also ad Cmd+Shift+T to reopen last closed tab.
16 changes: 0 additions & 16 deletions SafariTabSwitching/SafariTabSwitching.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,6 @@ - (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 e647aec

Please sign in to comment.