Sunday, February 26, 2012

Ending the tyranny of the mouse -- in web browsing

Since I plan to program professionally, I've ramped up my efforts to get by without a mouse, and I thought I'd share some key tools I've used to accomplish this.

For web browsing, the key is Pentadactyl, a Firefox extension that lets you do the things you want from the keyboard. (I would say all the things, but some websites are written so as to be unfriendly to it.) For example, if you want to click on a link, you hit f, and it pops up a keyboard code over every link, and you type the code to "click" on it. Here's what it looks like when you use it:



Other useful features are:
back/forward = shift+H / shift+L
page down/up = space bar / shift+space bar (these work without Pentadactyl)
half page down/up = ctrl + d / ctrl + u
search = / (yes, the slash key), then enter, then n/shift+N to search down/up
go to URL = o, space, [page url] (if you've entered something similar before, you can tab through the cached options)
go to URL in new tab = replace "o" in the above with "t"
open link in new tab: ;t , then it pops up hints as if you had pressed f but opens in a new window

However, you need to configure it a bit in order to get the most out of it. For example, as initially installed, it will remove your ability to use the familiar ctrl +c/v/a (for copy/paste/select all) due to its being based on the text editor Vim. Also, the hint keys (buttons used when creating a code that lets you click a click) are set by default to draw from the numbers 0-9, which are less comfortable to type every time you click on a link, and they are displayed too small to read.

To set your configurations, you need to create/edit a file called ".pentadactylrc" in your home directory. Here are the contents of mine, which fix the above problems:

"1.0rc1

loadplugins '.(js|penta)$'
group user
highlight Hint font: bold 10px "Droid Sans Mono", monospace !important; margin: -.2ex; padding: 0 0 0 1px; outline: 1px solid rgba(0, 0, 0, .5); background: rgba(255, 248, 231, .8); color: black; font-size: 14pt !important;
map -count -modes=i,n,v <C-c> <count><Pass>
map -count -modes=i,n,v <C-v> <count><Pass>
map -count -modes=i,n,v <C-a> <count><Pass>
map -count -modes=i <C-a> <Pass>
map -count -modes=i <C-x> <Pass>
set guioptions=bCrsmT
set hintkeys=asdfwervcxtgq
set hinttimeout=500

" vim: set ft=pentadactyl:


Enjoy your breaking the tyranny of the mouse! (And yes, I composed this entire post, including creating the link, without using the mouse. I may have mentioned that a few times before).

7 comments:

Anonymous said...

Now if we could just overcome the tyranny of the keyboard! Just our minds and laptop!

Silas Barta said...

You joke (I think), but I'm hoping to do just that: use existing brain-computer interface (BCI) technologies (such as the OCZ "neural impulse actuator" that I got about a year ago) to come up with a more user-friendly way to communicate with the computer such that the keyboard *and* mouse are entirely bypassed.

Silas Barta said...

"Remember, young one: keys are not moving, mouse is not moving. Mind is moving."

ooooo....

Jason Odegaard said...

Are you using vim quite a lot?

Anonymous said...

I've been doing the same thing a while back. You should check out Opera: its keyboard navigation is easily configured without having to install any addons. I used something like the following scheme:
- scroll up/down: w/s
- back/forward: a/d
- navigate between links: i(up), j(left), k(down) and l(right)
- google search or input URL: g

This way your fingers never leave "home row", and there's no need for the - quite frankly - somewhat ugly link visualization in your screenshot.

/John

Anonymous said...

How come you use Ubuntu? Is that better than Windows for developers or something?

Don't a lot of programmers use Apple?

Unknown said...

Have you seen the latest ergonomic mouse reviews? I already have bought 18 pairs for my company work.We're using these for so long. And you know,it has increased our productivity about 30% and increasing the profit as well.You can try it too.