From d61ebc2385f9f8053014e3eee9476b2eff52cf7a Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 17 Jul 2013 11:37:27 -0400 Subject: [PATCH] Support J/K as hotkeys for page_down/page_up (imported from commit f4d092e3a3ccd5fad5e39fb6e6c454fbfeddfa50) --- templates/zephyr/keyboard_shortcuts.html | 6 +++--- zephyr/static/js/hotkey.js | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/templates/zephyr/keyboard_shortcuts.html b/templates/zephyr/keyboard_shortcuts.html index d4196c5ba8..2d462d0e46 100644 --- a/templates/zephyr/keyboard_shortcuts.html +++ b/templates/zephyr/keyboard_shortcuts.html @@ -24,11 +24,11 @@ Initiate a search - PgUp, PgDn - Scroll up or down + PgUp, K + Scroll up - Spacebar + PgDn, J, Spacebar Scroll down diff --git a/zephyr/static/js/hotkey.js b/zephyr/static/js/hotkey.js index 7c552ac921..e2ff6d7522 100644 --- a/zephyr/static/js/hotkey.js +++ b/zephyr/static/js/hotkey.js @@ -27,6 +27,10 @@ var actions_dropdown_hotkeys = [ ]; function get_event_name(e) { + // Note that multiple keys can map to the same event_name, which + // we'll do in cases where they have the exact same semantics. + // DON'T FORGET: update keyboard_shortcuts.html + if ((e.which === 9) && e.shiftKey) { return 'shift_tab'; } @@ -74,6 +78,10 @@ function get_event_name(e) { return 'show_shortcuts'; case 67: // 'C' return 'compose_private_message'; + case 74: // 'J' + return 'page_down'; + case 75: // 'K' + return 'page_up'; case 82: // 'R': respond to author return 'respond_to_author'; case 83: //'S'