Ditching the mouse for pure keyboard navigation

This has been a long time brewing, and to put it simply, I’m tired of the mouse. I mean, it’s a great and awesome tool but sometimes it’s just not.. adequate. Or maybe a better way of putting it is that for some tasks, it’s not really purpose-built for it.

Especially when you’re dealing primarily with text.

Coding, reversing, reading source code, blogging, online discussions (irc, instant messaging, emailing, responding to an article, whatever really). Maybe you’re one of those people who likes the keyboard so much that you go to some lengths to optimize your daily experience around using the keyboard, like say, browsing the web with a plugin such as Vimium.

It’s good, by the way.

vimium_logo

If that’s most of what you do, in whatever percentage of each, on a daily basis, you would realize that more often than not, what’s going to happen is that you’re typing away at the keyboard doing something, and then something else happens that interrupts you.

For instance, that could be your project mate buzzing you with a quick question on whatever messaging client you use. And then, you pick up the mouse, speedily target that window, hit on it, and then go back to your keyboard to reply, grab the mouse again, hit back to the window of whatever it was you were doing more, and then your hand goes back to the keyboard, again.

In other words, the primary use of the mouse in the world of a keyboard warrior, literally, is going to revolve around window switching.

Moving to pure keyboard-based window switching

So, I wanted an effective way to switch around windows while keeping my hands on the keyboard. In other words, Vim style.

Now I’m not going to try to prove that keeping your hands on the keyboard for window switching is faster or slower than using the mouse to do so. I personally believe it is faster, but I can’t prove it, and right now I’m not interested in proving it. What I do know is that keeping your hands on the keyboards has two obvious benefits:

  • it feels good
  • less context switch (on the brain)

The key is the first one – it feels good to stay on the keyboard.

And so began my quest to look for a nice solution that allowed me to optimize window switching around using the keyboard rather than the mouse. This meant that the solution needed to be:

  • constantly accessible (from the keyboard)
  • it finds me what I’m looking for
  • it allows me to quickly correct it when it gets me wrong
  • not too complicated (hey it’s just window switching)

It turns out that window switching is not that easy ;) Every application has windowing behavior that is slightly different. Some applications house all their windows in one big window, and others create multiple windows all over the place. Others, like browsers, have this idea of.. tabs! Yes ultimately, from the programmatic point of view, they’re all windows, but yet they’re subtly different from each other.

Hence, given that I couldn’t find a good solution to this issue of window switching, I decided (with a friend to create my own. The goal is simple:

Make window switching a keyboard only affair, and let me get to any window (unless it’s hidden), using a small number of keystrokes that I can easily remember.

And so, focii was born. After using it for a good part of half a year, even to the point of having “cold turkey” days where I disconnect my mouse and try to get through the day using focii alone, just so see where it falls short, I think it’s now sufficient for normal use.

Now, as with any early-stage home-brew solution, I’m certain it’s not complete. Some things were intentionally omitted (I believe that being very predictable is much more important than trying to be too smart), but others I’m sure I simply never thought of it. So, as a final note, if you’re gonna use it and you’re feeling generous, please, I would love your feedback.

Here’s a quick primer on how to use it:

Find a window

The main keystroke is ctrl-;. This is a global key-binding that opens the main focii search window. In this window, you can enter a search term. It will then find a window that best matches that search term.

The search window looks like a small bar in the middle of the screen. If you have multiple screens, it’s going to appear on the screen where your mouse cursor is. This may change.

focii_search_bar

And here’s how it searches:

  • Among program names (e.g. chrome.exe, firefox.exe, winword.exe)
  • Among window titles (i.e. the text that’s usually in the title bar)

And really that’s it. The key thing to remember is that it is going to open the first correct match it finds. Note that it searches against program names (the name of the executable, for instance), and not the common name of the program (e.g. Microsoft Word).

Can I be more specific?

Actually you can. You can search amongst programs and their window title, at the same time. Meaning, for instance, you have 20 Microsoft Word windows open, and you want to find the one that is display the “readme.doc” file.

Then you can do this search query:

word!readme

And it’s going to open the first document that is open is Microsoft Word. The assumption is that the program name “Word” matches “Microsoft Word” and not something like “Wordpad”, for instance. If there is ambiguity, you just need to be more specific:

winword!readme

Oops, it got it wrong, now what?

Focii gives you two methods to recourse if it gives you the wrong window. The first is to switch among windows that matches the search term, but was not the first match. The key-binding is:

win-;

The second method of recourse is for you to switch among windows of the same application, no matter what those windows are. They key-binding is:

alt-;

The exception to the alt-; is if the window is not a Windows (the operating system) recognized window. A good example are tabs (i.e. browser tabs, for instance). These tabs are implemented not in a way that Windows can trivially enumerate, and hence Focii doesn’t switch among them. However, most applications that implements tabs allows you to switch easily among them anyway. A seemingly consistent standard is ctrl-tab.

Hence, I believe and hope that with these key combinations at your disposal, it becomes fairly quick and easy to get to the window you want, keyboard-style.

Auxillary utilities

Focii also gives you some other goodies, if you will.

Flashing current window

First of all, when you switch between windows, it flashes the active window. This gives you a visual cue where you are. In addition, if you lose track (since you’re not using the mouse), hitting:

ctrl-alt-;

will flash the current active window.

Starting a program

In the spirit of a launcher, typing

!<program-name>

will have Focii search the start menu for a matching name, and start that process. Note that this is not window switching. I’d also like to say that this is not Focii’s main aim, and hence may not be the most intelligent or advanced launching mechanism around ;)

focii_launcher

Where can I get it to play around?

Find Focii here:

Focii on Github

Once again, this is still very new, so please give me your feedback!