Keyboard Navigation for Comments? November 21, 2008 4:04 PM   Subscribe

PonyFilter: Keyboard navigation for comments, similar to what's demonstrated here, except the pagination hack wouldn't be necessary (unless you wanted it to go to the next thread instead of the next page). 'j' would go one comment down the page and 'k' would go one comment up the page. It'd be a real nice addition!
posted by WCityMike to MetaFilter-Related at 4:04 PM (31 comments total)

We already have keyboard shortcuts for scrolling mapped to the . (down) and , (up). I'm not sure they work in all browsers, but they're working for me in FF/Mac.
posted by pb (staff) at 4:10 PM on November 21, 2008 [1 favorite]


Hey Matt and pb, could you also code something up real quick that would hold my penis for me while I urinate? tia.
posted by dersins at 4:13 PM on November 21, 2008 [3 favorites]


> We already have keyboard shortcuts for scrolling mapped to the . (down) and , (up). I'm not sure they work in all browsers, but they're working for me in FF/Mac.

I had no idea. That's awesome.
posted by WCityMike at 4:19 PM on November 21, 2008


That's cool, I never knew that.
posted by Brandon Blatcher at 4:21 PM on November 21, 2008


I use the arrows.
posted by lee at 4:40 PM on November 21, 2008 [2 favorites]


The . and , works on front pages too (or at least it did three years ago when delfuego sent me the code)
posted by mathowie (staff) at 4:49 PM on November 21, 2008


Hey Matt and pb, could you also code something up real quick that would hold my penis for me while I urinate?

We're calling it the Piss Friend Forever. See the add on your local network affiliate, 3:15-3:20 am.
posted by cortex (staff) at 4:54 PM on November 21, 2008


req. j/k for next/ previous story ala google reader
posted by boo_radley at 4:54 PM on November 21, 2008


Hey Matt and pb, could you also code something up real quick that would hold my penis for me while I urinate?

There is someth^H^Hone on the site that does this but I don't think you're going to like it.
posted by jessamyn (staff) at 5:22 PM on November 21, 2008


The . , thing is freaking awesome. PB deserves worshipping.
posted by Phire at 5:23 PM on November 21, 2008


Yes, fan mail for punctuation marks that navigate. Cheers, pb.
posted by fixedgear at 5:40 PM on November 21, 2008


Just out of curiousity, is this a situation where someone who reads Javascript better than I do could code up something for Greasemonkey that replaces the , and . with j and k?

I'm not looking the ,/. gift horse in the mouth, and in fact am thoroughly grateful for it -- it's just that j and k aren't universal yet but are showing up in more and more locales, so they're getting ingrained in people's muscle memory. I took a look at the *.js files in the header, and the prototype.js file was incomprehensible, and comments.js didn't appear to have the keystroke code.
posted by WCityMike at 7:54 PM on November 21, 2008


Yeah, you could probably modify this with Greasemonkey. The relevant script is navkey061208.js, linked in the footer. Take a look at the navkey() function, and if you can replace that with your own via Greasemonkey, you should be able to do it.

I'd like to take credit for this, but it was here when I got here. Like Matt said, MeFi has had this for over three years now.
posted by pb (staff) at 8:03 PM on November 21, 2008 [1 favorite]


I was hoping I could mash that and this together, but I think it's above my head ...
posted by WCityMike at 8:18 PM on November 21, 2008


Just read the site. Have you ever, like really, read what you scroll past? And have you ever like really looked at your hands?
posted by Burhanistan at 9:02 PM on November 21, 2008


The ,/. trick is incompatible with my beloved "search for text when I start typing." I can't imagine how they could co-exist peacefully, but I hate having to choose one.
posted by paisley henosis at 12:13 AM on November 22, 2008


That annoyed me when the nav thing was added, paisley, but if you're using Firefox, you can turn off 'search as you type' and effectively still use it by prefacing what you type with a "/" - I got used to triggering search this way in about a day, and it feels just like search as you type, unlike hitting Command+F.
posted by jack_mo at 3:45 AM on November 22, 2008 [2 favorites]


mathowie wrote: The . and , works on front pages too (or at least it did three years ago when delfuego sent me the code)

It works pretty much everywhere, but is slightly off on some pages (eg. Recent Activity, where it gets confused if one of your own comments is in the last ten shown, or Favourites, where it jumps a little bit too far ahead). Still, perfectly usable even on those pages, and the only way to read the site as far as I'm concerned.

Belated thanks, delfuego!
posted by jack_mo at 3:51 AM on November 22, 2008


Oh, and people who want j and k instead of . and , could try this Greasemonkey userscript - dunno if it still works, it did in 2006 when this last came up.

(I can't find the thread where the feature was announced, but remember there being some reason why using j and k for the built-in navigation wouldn't work - it made people's heads explode if they were browsing the site with Lynx, or something like that.)
posted by jack_mo at 4:05 AM on November 22, 2008


Found it. (I was nearly right: bonaldi was angry about Mozilla 1.3 for OS9, then some other people started talking about vi, and my eyes glazed over.)
posted by jack_mo at 4:17 AM on November 22, 2008


~ That annoyed me when the nav thing was added, paisley, but if you're using Firefox, you can turn off 'search as you type' and effectively still use it by prefacing what you type with a "/" - I got used to triggering search this way in about a day, and it feels just like search as you type, unlike hitting Command+F.

Excellent solution, thanks!
posted by paisley henosis at 8:08 AM on November 22, 2008


jack_mo: "Oh, and people who want j and k instead of . and , could try this Greasemonkey userscript - dunno if it still works, it did in 2006 when this last came up."

It doesn't look like it works anymore. Unfortunately, it uses some XPath magic instead of just depending on nextArticle() and prevArticle() in navkey061208.js.

Here's one that works and should hopefully be forward-compatible. I'd be happy to support Emacs shortcuts too, but it would unfortunately keep C-n from doing what most people expect. And using A-n for next comment just feels wrong.
posted by Plutor at 8:42 AM on November 22, 2008


:wq
posted by xorry at 8:48 AM on November 22, 2008


Am I in the minority for positioning the block of text I'm reading towards the middle of the browser window? This functionality leads me to believe that others read the text at the very top of the screen and then want it to scroll off immediately when they're done. Maybe I jump around when I read or something?
posted by danb at 7:49 PM on November 22, 2008


I like to have my reading material near the top of the browser, but not quite at the top—I want a couple lines of buffer, including ideally the last line of the previous paragraph (or comment byline) so that I can anchor myself to the bit I just moved on from.
posted by cortex (staff) at 9:35 PM on November 22, 2008 [1 favorite]


Interesting. The "anchoring" thing is key for me too, but I just tried reading a thread using only the previous byline and it stressed me out something awful. It's like seeing a widow.

Given your proclivity, cortex, do you use the keyboard navigation shortcuts? I suppose you'd need to hit period and then the up arrow, if so.
posted by danb at 9:59 PM on November 22, 2008


Yeah, I never touch the stuff. I tend to float over to the mousewheel, or use the arrow keys for fine adjustments.
posted by cortex (staff) at 10:18 PM on November 22, 2008

I like to have my reading material near the top of the browser, but not quite at the top—I want a couple lines of buffer, including ideally the last line of the previous paragraph (or comment byline) so that I can anchor myself to the bit I just moved on from.
A number of old text based things would briefly highlight the line that used to be the last line on the screen, which would be near the top after scrolling. (rn would do this, I think). Especially handy for not losing your place on the last screenful when you need to track your eyes only partway up the window. I kinda miss it, although smooth scrolling solves the problem also.
posted by hattifattener at 2:47 AM on November 23, 2008


cortex wrote: I like to have my reading material near the top of the browser, but not quite at the top—I want a couple lines of buffer, including ideally the last line of the previous paragraph (or comment byline) so that I can anchor myself to the bit I just moved on from.

I'm not so fussed about seeing the last line of the previous para, but the keyboard nav does jam comments right up against the browser chrome, which isn't very easy on the eyes. You can fix that by putting something like

.comments {padding-top:20px;}

in your userContent.css, a Greasemonkey script or using Stylish.
posted by jack_mo at 4:04 AM on November 23, 2008


I should note as an addendum that if I'm really powering through something (say, trying to rapidly catch up on a trainwreck thread on a certain internet website after coming back from lunch to find that it exploding out of the flag queue, to contrive an implausible hypothetical example), I'll often just read top to bottom and hit spacebar and repeat. The line-or-so of context is good enough if I'm not distracted.
posted by cortex (staff) at 7:46 AM on November 23, 2008


If the interaction model isn't the same as GMail, then I remain disappointed. I've gotten used to disappointment.
posted by jeffamaphone at 8:56 PM on November 23, 2008


« Older Comment Search: The Specificking   |   Vaya con Dios, Lu. Newer »

You are not logged in, either login or create an account to post comments