KeyStroke is a Safari extension that provides customizable keyboard shorcuts for common tasks and enhancements.

screenshot

Download KeyStroke 2.4.1 (Open the file if it doesn't install automatically)

Getting Started

  1. Install the extension and then click the backwards toolbar item.
  2. Customize your keys and then click Save.
  3. Click Inactive to turn the keys on.
  4. Reload any existing pages.

F.A.Q.

  1. What's new in 2.0?
    Full keyboard access (modifiers, function keys, etc.).  It's possible to "overload" or steal many of Safari's own shortcuts.
  2. Where did some of the preferences go?
    Advanced preferences are hidden by default (accessible by an access key along with the other links).
  3. Why aren't my keys working?
    Try reloading the page. Make sure JavaScript is enabled and Active is displayed. The page may have an unusual layout so try clicking on (or tabbing to) the main content or focusing the page. Finally, Safari extensions don't work at all on some pages (like file:/// local files).
  4. What does this key do?
    Most of the keys should be self-explanatory.
    • Next Page tries to guess the next page in a series. You can customize the pattern with your own comma separated values (any regex). The Space Bar will also work at the bottom of the page is so desired.
    • Focus Field moves focus to a plausible text field. The Escape key returns focus to the page.
    • Wrap Text tries to break long lines of text to eliminate horizontal scrolling. It's a bit of a poor substitute for Opera's Fit to Width.
    • Link Text Links turns cold links into clickable ones. The Enter key activates highlighted links when the page has focus.
  5. How do I create my own keys?
    See this post for some examples.
  6. How do I apply a list preference to all sites?
    With an asterisk. For example to enable KeyStroke on frames on all sites Force Active Automatically should just be *
  7. How do I change the default zoom level in Safari?
    A custom CSS file is one solution.
  8. How does it all work?
    Through injected JavaScript. This includes zooming (which is distinct from Safari's own zoom) since native code isn't supported. I'll continue to optimize the code, though I haven't noticed any lag on my test machine: 2.26 Core 2 Duo Mac Mini (Mavericks).
  9. How do I uninstall everything?
    Safari > Preferences > Extensions > Uninstall removes the extension but the storage file may have to be manually removed from ~/Library/Safari/LocalStorage/.  Reload any existing pages.
  10. Where can I direct further questions?
    The support forum.

Tips and Tricks

  • Home and End double as Restore so you don't lose your place.
  • Use Focus Page to break out of Flash and frames.
  • Shift-Space at the top of the page works analogously to Space at the bottom for Next Page.
  • Cmd-G > Enter is quicker than Cmd-F > "text" > Esc > Enter.

History

  • 2.4.1 [6 Jan 14]
    • Updated for Safari 6.1 / 7.0.
    • New keystrokes - Set Mark, Jump To Mark: Bookmark, return to window scroll position.
  • 2.3.5 [3 Oct 12]
    • New option - Add Key [+]: Create your own keys.
    • New preference - Special Priority Elements: Disable toggled keys when these elements are present. [2.3.4]
    • New preferences - Next, Previous Elements: Elements in addition to text for Next and Previous.
  • 2.2.3 [19 Aug 12]
    • New keystroke - Force Active: Turn on keys on all frames.
    • New keystroke - Break Frame: Open frame in current tab.
    • New preference - Field Elements: List of preferred elements for Focus Field.
    • New preference - Clear Selection: Clear highlighted text with Focus Page.
    • New preference - Update Elements: Dynamically update Disabled Elements (Safari 6).
    • Keystrokes now work in Reader (Safari 6).
    • Show Reader Automatically now customizable per domain.
    • Set Page removed: Now automatic.
    • List color mnemonics reordered and renamed with informative descriptions.
  • 2.1.3 [26 Jun 12]
    • Toggled versus fixed keys now customizable.
    • New preference - Greylist Disabled Elements: List of elements where toggled keys are disabled. [2.2.1]
    • New keystrokes - Set Page, Swap Page: Swap back and forth between two tabs / windows. [2.2.1]
    • New keystrokes - New Tab, New Window, Homepage: Further customizable in advanced preferences.
    • Follow Link keystroke and Two-digit tabs now customizable.
    • Fixed cross-origin frames in Bluelist.
    • New keystrokes - Move Tab Right, Move Tab Left: Cycle past the end.
  • 2.0.4 [27 Apr 12]
    • Full keyboard access.
    • Two-digit tabs selectable with the zero key (e.g. 013 selects the 13th tab, 009 selects the 9th, 9 still selects the last one).
    • Whitelist removed: KeyStroke overrides (most) site shortcuts by default. [2.3.5]
    • Backspace Focuses Field removed: BS can now be directly assigned to any function.
    • Scroll, Page and Zoom increments now customizable.
    • New keystroke - Parent Domain: Up one domain (e.g. store.apple.com to apple.com).
  • 1.6.3 [19 Jan 12]
    • Lion and Windows 7 upgrades.  Homepage moved to Google Sites.  Forum link added.
    • New keystroke - Show Reader: Activate Safari reader.
    • New preference - Auto Reader Show Reader Automatically: Automatically invoke Safari reader. [2.2.1]
    • New preference - Bluelist Force Active Automatically: List of domains where KeyStroke is enabled on frames. [2.2.1]
    • Fixed XHTML/XML pages.
    • Added optional Ctrl modifier for selecting tabs.
    • Merged Open / Save Preferences keystrokes.
    • New preference - Safari Cache Hack: Temporary workaround for Safari 5.1 cache bug.
  • 1.5.3  [11 Jun 11]
    • Redesign. Preferences moved to a separate file. Toolbar item reflects Active state.
    • Skip Back and Forward now customizable.
    • New keystroke - Close Page: Probably should have been here all along.
    • New preference - Greenlist Focus Page Automatically: Automatically focus page instead of text field on these domains. [2.2.1]
    • New preference - Redlist: List of domains where KeyStroke is disabled on frames. [1.6.1]
  • 1.4.4 [19 Dec 10]
    • New preference - Blacklist Disabled Sites: Comma separated list of domains where KeyStroke is disabled (Site > KeyStroke). [2.2.1]
    • New preference - Whitelist: Attempts to disable that domain's keyboard shortcuts in favor of KeyStroke's (KeyStroke > Site). [2.0]
    • New preference - Backspace Focuses Field: Puts you back in a text field instead of back one page. [2.0]
  • 1.3.3 [5 Dec 10]
    • Custom, multilingual Next/Previous patterns.
    • Page reload no longer necessary after key change (except in Back/Forward cache). [2.2.1]
    • New preference - Numbered Tabs: 1 selects first, 9 selects last tab.
    • New preference - Remember Zoom Settings: Retain zoom settings across sessions. Note that all zoomed sites are stored, even when Private Browsing is enabled (until Apple supplies a fix). [2.2.2]
  • 1.2.2 [21 Nov 10]
    • Remember zoom level per domain per window/tab.
    • Zoom relative to CSS default.
  • 1.1.1 [11 Oct 10]
    • New keystroke - Toggle Active: Activates/Deactivates all keys that aren't fixed (checked). [2.1]
    • New preference - Disable on Frames: Slightly better performance. [1.5.3]
    • Disabled on Gmail. [1.2.2]
  • 1.0.0 [19 Sep 10]
    • Initial release. The default shortcuts largely come from Emacs' Info-mode and the pager /usr/bin/less.

Links

  • keyconfig : A more powerful Mozilla extension.  You've probably already heard of it.
  • Vimari : Another keyboard-friendly Safari extension.  Based on Vimium, Vimperator and Hit-a-Hint.
  • AutoHotkey (Windows) : Excellent utility.  A keyconfig for your entire OS.
  • KeyRemap4MacBook (OS X) : Swap ESC & Caps Lock, system-wide Emacs keybindings, other goodies.  Not just for MacBooks.