31 March 2008

I posted this with Ctrl+P

OK, try this. I think all browsers have a file menu; if your browser doesn't have a file menu, find one that does. Open the file menu. Done? Good job. Now, did you in any way touch the mouse? If you used the mouse to open the menu, you're doing something very wrong.

I was recently forced in class to read a thing about how wonderful the Mac menu system is. Seriously, I had to explain why Mac OS is clearly the superior operating system. For credit. I don't have the lecture material, but suffice to say Mac menus are awesome because the current window's menu is always at the top of the screen, so you can just fling your mouse to the top of the screen and easily click the menu. Now, obviously this ignores the whole still-need-to-position-horizontally problem, which I would think pretty much kills the time gain, but apparently studies say it really is faster. However, this also ignores the you're-using-completely-the-wrong-interface problem. The approximate order of increasing input device speed is:

  1. Prayer

  2. Mouse

  3. Keyboard

  4. Mind reading


The mouse has lots of useful applications, but my definition of "lots" is degrees of magnitude smaller than most people's. People used to watch me use computers in middle school and giggle that I never used the mouse, and while "never" is an overstatement it's fairly accurate compared to the rest of them. The mouse is stunningly overused, because people are too lazy to learn the keyboard ways to do stuff. You don't even have to bind your own shortcuts, just the default ways to do things will massively speed up your productivity.

If you need to run a program, Super+R opens the run dialog in Windows, Meta+F2 in GNOME. I can't remember the last time I manually opened a run dialog, and I almost never use a shortcut or a start menu item to launch a program, it takes forever. Super+D/Ctrl+Meta+D shows the desktop, although hopefully if you're doing this you're not going to need desktop shortcuts anymore so this won't come in handy very often. Here's one nobody seems to know: Super+Pause opens the System properties dialog. Never right click My Computer again. Want to open the start menu? There's a dedicated key on the keyboard for it. Stop clicking the start menu and hit the key with the pretty windows symbol on it. Then hit the first letter of the menu you want to jump to, P for programs, S for search (although Super+F will get you there faster anyway), etc. Just learning basic navigation keys for documents makes life so much easier. You don't need to be a vim ninja, just knowing that Ctrl+End will get you to the end of the document in most programs is helpful. Highlighting by holding Shift and an arrow? Hold down Control too and each arrow press will jump one word instead of one character.

Now, if you're feeling super crazy, you can set up your own hotkeys to do stuff. I don't know the canonical way to do this in Windows, but most programs come with their own way to deal with hotkeys. Under Linux I use XBindKeys, which lets you map keys to commands really easily. Here's one of my entries:

mpc toggle
Alt+Mod4 + space

When I hit Meta+Super+Space, it runs "mpc toggle", which pauses or unpauses my music. I have a bunch for MPD, a bunch of others for MPlayer (for videos), and a handful for miscellaneous other programs. For maximum fun, you can get peripherals. I have a Saitek Command Pad and a Griffin Powermate, and I use Gizmod to control both of them, which lets you write Python scripts to deal with input devices. In short: bonus hotkeys. Global hotkeying is much easier in Linux because everything is doable from the command-line, but I imagine a lot of this can be accomplished in Windows as well.

Side note: Coincidentally (I started writing this like a week ago when I had the evil lecture of mac-loving), there's an article on Coding Horror about how using the keyboard tends to take longer than using the mouse when learning a program. This is probably true, although with hints like letters underlined in menus I would think the keyboard would be able to keep up just about from the beginning. Nonetheless, once you know how to use the keyboard, it's always going to be faster, so if it's a program you use regularly it's definitely worth the effort. Google understands this, and all of their web applications have hotkeys built in, which is something incredibly lacking in web UIs for some reason. I hit Ctrl+S to save my draft of this entry, and Ctrl+P to publish it. In Google Reader (which i highly recommend), J and P jump to the next/previous entry in the list, and V opens the current selection in a new tab. There are other hotkeys, I don't remember them because I don't use them often, but just remembering two or three saves time.

No comments: