HOWTO: keyboard shortcuts (not access keys) on websites?
January 9, 2008 1:18 AM   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 answers 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




<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 Anal on Saturday night, how to prepare Friday or...   |   Never thought I'd ask this, but: Name that song! Newer »
This thread is closed to new comments.