« |
Main
| »
January 01, 2010
This is probably my most trivial greasemonkey script yet, but perhaps
the most useful...upanddownpage lets you
use one hand to page up and page down on macs. Again, the code is
very trivial, but I find myself doing something with at least one hand
(insert dirty jokes here), like playing guitar or writing, while I'm
looking at a web page; and I don't want to use both hands to just page
up or page down. Normally it's fn+up and fn+down -- fn on the far
left, up/down on the far right, and this is a pain. You can switch
tabs, go back, go forward, go up, go down, go to page end, and go to
page start with one hand -- it's just inconsistent to exclude page up
and page down. And, yes, it's utterly trivial:
window.addEventListener('keydown',function(e) {
if (e.keyCode == 38 && e.altKey) window.scrollByPages(-1);
else if (e.keyCode == 40 && e.altKey) window.scrollByPages(+1);
},true);
Oh yeah, happy new year.
Posted by jeff at January 1, 2010 12:01 AM