07
Mar
jk
Last Updated: March 8th, 2013

Being a huge fan of keyboard shortcuts (I have most of Gmail's keys memorized and use them exclusively for maximum productivity every day), I jumped at the opportunity to add similar functionality to AndroidPolice.com itself.

On various pages of the site that contain multiple posts, like the homepage, category, author, and tag pages, you can now:

  • press "j" to jump to the next article in the list
  • press "k" to jump to the previous article in the list
  • press "o" or "Enter" to go to the article that's closest to the top of the visible browser area
  • (new) press "O" to do the same as above, except in a new browser tab/window
  • (new) press "c" or "C" on a post page to zoom to the comments box

Furthermore, if you're at the end of a list, pressing "j" will advance to the next page. The same goes for "k" and start of a list - you'll be taken to the previous page.

Go ahead, try it now and let us know what you think down below.

Hat tip to Ayaskant Rath from our Android Police Google+ Community for the suggestion (you're already a member as well, right? Right?).

Artem Russakovskii
Artem is a die-hard Android fan, passionate tech blogger, obsessive-compulsive editor, bug hunting programmer, and the founder of Android Police.
Most of the time, you will find Artem either hacking away at code or thinking of the next 15 blog posts.

  • Andy

    Damn, makes things so much more convenient!

    • http://www.androidpolice.com/ Artem Russakovskii

      Damn, cool.

      • http://www.facebook.com/profile.php?id=100000003999549 Mike Harris

        I agree. This is very, very cool. I'm a big proponent of keyboard shortcuts myself.

        Just out of curiosity, is there any way to set it so that when it opens an article, it opens it in a new tab? I don't mean to sound greedy, but when I'm on this site or any other similar site, I always open the articles I'm interested in in another tab so I can keep scrolling through the main page.

        • http://www.androidpolice.com/ Artem Russakovskii

          Ask and you shall receive, once again.

          I thought about how not to break the paradigm for existing users, and created another option - capital letter "O" instead of "o" or Enter. This option will now open a new tab.

          Just make sure to empty the cache first by Ctrl-F5ing.

          How's that?

          • http://www.facebook.com/profile.php?id=100000003999549 Mike Harris

            Holy crap, that's awesome. Now it's perfect!

            Though, it would also be cool if, while in an article, you could hit something like "c" to go directly to the comments. Then it would be extra perfect. =)

          • http://www.androidpolice.com/ Artem Russakovskii

            Done.

          • http://www.facebook.com/profile.php?id=100000003999549 Mike Harris

            Wow, you are really making navigation a lot easier here. Thank you!

  • Sootie

    Loving your work, now where was this retro themed full site make over and mobile app you hinted at a while back?

    • http://www.androidpolice.com/ Artem Russakovskii

      I don't know about retro but it's coming.

      • Sootie

        I only say retro because of a comment someone made on a (very awesome) logo you were using for last years CES (I think) which looked like the Vegas sign.

        I'm not a creepy stalker or anything I swear.....

      • Athishay

        Artem, please please please redesign the site!
        This is one of the most KICK ASS Android sites ever, and it looks SO 2010! (no, not hipster :P)

        And where's the mobile app? Last time I asked you, you said 'testing' so why can't we test too?

  • http://twitter.com/WoShiJiawei Adrian アドリアンタン郭華

    If i may ask, what plugin was used?

  • Sorian

    For a second there I was wondering if this was an April Fool's Joke.

  • SF

    Very nice feature! Great job guys.

  • DavidB

    Hey...that will make reading the site on the Q10 that much easier! From an Android, not so much.

  • James Day

    Odd. I've been using j and k already for a few weeks now on Android Police.

    • http://www.androidpolice.com/ Artem Russakovskii

      I kind of sat on this post for a while.

      • Wam31

        That's pretty handy and awesome, but it doesn't seem to work once you've reached the last post of the page to the next page's first post. I get "http://www.page.fr/2/" in the adress bar...

        • http://www.androidpolice.com/ Artem Russakovskii

          That's weird - what browser/OS are you using?

          • Wam31

            I think I figured it out.
            I'm using Opera which has native mouse gestures.
            Right click towards the left or right does previous/next page (like Firefox with the FireGesture plugin). I use them extensively.

            In Opera, there's an awesome feature that, even when you don't have a "next" stack (never went back, "next" button disabled in toolbar) AND if the page uses paging, going next with a mouse gesture will automatically go to next page !

            I always go to next pages this way but I guess there might be a conflict here with your feature and Opera's implementation of "Next Page" using mouse gestures...

          • Wam31

            More Info :

            Definitely a problem linked with Opera "auto-next" feature.
            Only does it on the first page. Works after that.

            Problem seem to come from the "page/2" added at the end of the URL. the "window.location" is replaced by "page/2" instead of "/page/2" which resolve to "http://www.page.fr/2/"...

            I didn't go into the code yet, just notice the url changes.

            I wouldn't blame you if you don't fix it though. Not a lot of people using Opera ;-)

          • http://www.androidpolice.com/ Artem Russakovskii

            Cheers, fixed that. Damn you, Opera! Just Ctrl-F5 your browser.

            Now, if you could potentially help me figure out another bug in Opera I noticed. On /page/2/, it doesn't go back up to the homepage if you click "k" on the first item.

          • Wam31

            You're right. Didn't ever notice. I'll take a look.

          • Wam31

            BTW, I love Opera and all, but there are still some quirks here and there. And Firebug still has NO competition IMO.
            But to be honest, this wasn't really its fault one that one :-)
            Firefox was just doing a better job at correcting URL inconsistencies...

          • http://www.androidpolice.com/ Artem Russakovskii

            Yeah, I meant a bug that happens when you use Opera.

          • Wam31

            Well, apparently, when you do the replace on window.location.pathname with s = "", that means window.location.pathname = "" and Opera just reload the page, lol. Putting s = '/' works though...

            So :
            var s = p > 1 ? '/page/'+p+'/' : '/';
            or even
            var s = (p > 1 ? '/page/'+p : '')+'/';

          • http://www.androidpolice.com/ Artem Russakovskii

            Makes sense. Cheers, this is fixed. Your 2nd version was more elegant.

          • Wam31

            Thanks, glad I could help.
            On an unrelated note, when do you think you'll get your hands on a HTC One for a full review ? :-) Or if there's even a proper channel to ask for that kind of things...

          • http://www.androidpolice.com/ Artem Russakovskii

            We're not sure just yet, but whenever HTC gets around to it would be my guess.

          • Wam31

            Let's hope they will. Maybe they're just making sure the bootloader's locked as hell, but I can't wait !

          • Wam31

            So since it's lunch time here and I had nothing else to do I looked at the code and It actually doesn't have anything to do with Opera's Next Page feature.

            On the last line of code of the plug-in (prev-next-keyboard-navigation/pnkeynav.js?ver=3.5.1), you have :

            window.location.pathname = path + '/page/2/';

            with "path" being '/' (home page) which sends '//page/2/'

            Should be

            window.location.pathname = '/page/2/';

            on first page.

            Apparently, while Firefox doen't care, Opera doesn't like the double leading // in the pathname...

            If at any point you have time to remove the "path +", that would be great ! ;-)

          • Wam31

            Already fixed when I got home... Thank you very much, sir !

  • VegasDude73

    this is beyond cool! haha

  • Somebody

    Using Chrome on Linux. Pressing K repeatedly works well, but J repeatedly doesn't work. I have to scroll down a little to make the current post scroll past the top of the browser and then press J. Would be nice if you can fix that.

  • http://www.facebook.com/ian.kavanagh4 Ian Kavanagh

    Awesome!

  • White Pawn

    I think it may be a good idea to make 'k' go to the last post of the previous page when hit from the top of a page. Right now, it just goes to the previous page.

    • http://www.androidpolice.com/ Artem Russakovskii

      Indeed, I'll make a note of that for the TODO list.

      • http://the-jade-domain.com Jaime J. Denizard

        I'd also like this to be implemented please. :)

        Also one thing I noticed is that if you use the J/K keyboard shortcuts while browsing search results, when you go to the next/previous page, it gives you the next/previous page of the website itself.

        Example: When you advance to the next page in the search results, you're supposed to go to /page/2/?s=SEARCHTERM but instead you get taken to /page/2/

        • http://www.androidpolice.com/ Artem Russakovskii

          Hmm, I just tested it in Chrome, and it keeps the search term correctly. What browser are you using?

          Sincerely,
          Artem

          --
          Founder, Android Police
          http://www.AndroidPolice.com | http://twitter.com/AndroidPolice
          http://beerpla.net | http://twitter.com/ArtemR

          • http://the-jade-domain.com Jaime J. Denizard

            Firefox

          • http://www.androidpolice.com/ Artem Russakovskii

            Doh, OK, reproduced. Added it to our bug tracker, but I'm not sure when I'll be able to fix it, unless someone with JS knowledge can help out by looking at wp-content/plugins/prev-next-keyboard-navigation/pnkeynav.js. It's a pretty obscure bug and seems to only happen in certain browsers (like Firefox).

  • Marcos Amano

    That's awesome!!!

  • Wam31

    Man, that's awesome ! Thanks !
    Scrolling past those posts about carriers phones updates when you're not even in the US was a pain...
    What a relief ! Love a good shortcut. Thanks again !

  • http://the-jade-domain.com Jaime J. Denizard

    This is great, thanks a lot Artem! My suggestion would be figure out how to make it so new readers know about this after this news post isn't in the first couple of pages anymore. Like let's say a flurry of new readers come in for Google I/O coverage...they have no idea this exists!

    • http://www.androidpolice.com/ Artem Russakovskii

      Maybe in the future I'll make some sort of "New at AP?" page...

      • http://the-jade-domain.com Jaime J. Denizard

        Sounds like a plan to me.

      • http://the-jade-domain.com Jaime J. Denizard

        So it's been four months now and it happened to me: I was looking for this article (couldn't remember the shortcut for opening things in a new tab) and it took me a while to find it. When can we expect this page to be permalinked somewhere? Maybe in the About page? :D (That's actually where I first looked for it lol)

        • http://www.androidpolice.com/ Artem Russakovskii

          When the new design hits, there will be an area with these.

          • VegasDude73

            It doesn't seem to be working in Chrome now for pressing "J" to go to the next article. It was working originally though... hmm.

          • http://www.androidpolice.com/ Artem Russakovskii

            Hrm, works for me in Chrome stable. Lowercase j still does the trick.

          • Guest

            See @archon810:disqus? He forgot about the feature! This has to be on people's minds! lol Make it happen :P

          • http://the-jade-domain.com Jaime J. Denizard

            This was me. For some weird reason when I delete a comment, it turns it into a guest comment. O_o #failDisqus

  • http://www.androidpolice.com/ Artem Russakovskii

    Added "O" to open in new tab/window, based on a suggestion from @facebook-100000003999549:disqus.

    • Guest

      I'm guessing the answer to this is "no" but it's worth asking anyway: Is there a way to make it so when you open it in a new tab, it opens in the background so I can keep browsing through the website while I open articles with my keyboard? The way it is now, the focus goes to the new tab and then I have to grab my mouse and go back to the original tab where I was browsing through articles. :-

      • http://www.androidpolice.com/ Artem Russakovskii

        I don't think that's possible to control.

        • http://the-jade-domain.com Jaime J. Denizard

          Sorry, that was me that posted that question, but then I scrolled down some more in the comments and saw that @google-1c61e87153bd6f4f8c31037e5c48d215:disqus had already asked the question..I just kinda forgot about it lol.

          I tried deleting the comment but then it just turned it into a Guest comment. Weird. O_o

  • http://www.androidpolice.com/ Artem Russakovskii

    Added "c" or "C" to jump to comments on post pages. Thanks, @facebook-100000003999549:disqus, again for the suggestion.

  • whargharbl

    Can't wait for AndroidPolice Smart-Nav, where I can navigate the site with my eyes.

    • http://www.androidpolice.com/ Artem Russakovskii

      In collaboration with Samsung. It's coming soon.

  • Peter

    Love it. Thanks

  • James Day

    I think I'd personally prefer it if "O" opened the article in a new tab/window in the background. I usually open several articles in the background as I'm scrolling through the site and read them after I've opened a few.

    • http://the-jade-domain.com Jaime J. Denizard

      I second that :)

    • http://www.androidpolice.com/ Artem Russakovskii

      Problem is, I don't think that's possible with Javascript. Your browser handles how that works if you press Ctrl or right click and select the appropriate option, but I don't think JS can control that. If someone can show an example that accomplishes it, I'd be glad to implement it.