HOWTO: keyboard shortcuts (not access keys) on websites?
January 9, 2008 1:18 AM   RSS feed for this thread Subscribe

Any idea how keyboard shortcuts on websites are implemented, a la Google Reader and ffffound.com?

I'm not talking about access keys, or maybe I am -- but I don't want to press Ctrl + a key to have it work, I just want to press the key. Specifically I want to implement this on my WordPress blog to allow for tapping through blog posts.
posted by jruckman to computers & internet (6 comments total) 2 users marked this as a favorite
A Javascript event loop that runs on page load watches for key combinations.
posted by rokusan at 1:59 AM on January 9, 2008


Here you go: http://www.openjs.com/scripts/events/keyboard_shortcuts/
posted by cdmwebs at 2:47 AM on January 9, 2008


If I understand correctly what you're asking for, we have it here. Press "." and "," to move backwards and forwards on MeFi. Maybe Matt can pop in and tell you how they did it. I believe there was also a MetaTalk post about it when it happened, and there might be details there.
posted by NotMyselfRightNow at 4:19 AM on January 9, 2008


Here's how it's done on this site.
posted by steveminutillo at 9:19 AM on January 9, 2008


<some_big_element Onkeypress="receive_key(e)">...</>


function receive_key(event e) {
  if (e.keyvalue_or_whatever == 'a')
    preform_action_for_a();
}

Something like that.
posted by cmiller at 9:23 AM on January 9, 2008


Some simple keyboard shortcuts can be done without javascript.
posted by Zed_Lopez at 11:21 AM on January 9, 2008


« Older Do you or anyone you know make...   |   help-my-dad-figure-out-the-son... Newer »

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



Related Questions
Help me fix my new blog. December 1, 2008
A Tool To Convert HTML to something importable... November 13, 2008
Wordpress theme editable region help August 13, 2008
My readers don't understand how permalinks and... October 29, 2007
Which PDA: just for typing up plaintext? January 9, 2006