diff --git a/static/js/activity.js b/static/js/activity.js index 55a8fab7cf..3d70d2cb58 100644 --- a/static/js/activity.js +++ b/static/js/activity.js @@ -372,6 +372,11 @@ exports.escape_search = function () { update_users_for_search(); }; +exports.initiate_search = function () { + var filter = $('.user-list-filter').expectOne(); + filter.focus(); +}; + exports.blur_search = function () { $('.user-list-filter').blur(); }; diff --git a/static/js/hotkey.js b/static/js/hotkey.js index 3ca08add1d..c09d579378 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -85,6 +85,8 @@ function get_event_name(e) { return 'vim_down'; case 107: // 'k' return 'vim_up'; + case 113: // 'q' + return 'query_users'; case 114: // 'r': respond to message return 'reply_message'; case 115: // 's' @@ -115,7 +117,7 @@ function process_hotkey(e) { } } - if (ui.home_tab_obscured() && event_name !== 'search') { + if (ui.home_tab_obscured() && event_name !== 'search' && event_name !== 'query_users') { return false; } @@ -260,6 +262,9 @@ function process_hotkey(e) { case 'compose_private_message': compose.start('private', {trigger: "compose_hotkey"}); return true; + case 'query_users': + activity.initiate_search(); + return true; case 'search': search.initiate_search(); return true; diff --git a/templates/zerver/keyboard_shortcuts.html b/templates/zerver/keyboard_shortcuts.html index b0e87854bf..c821eb7314 100644 --- a/templates/zerver/keyboard_shortcuts.html +++ b/templates/zerver/keyboard_shortcuts.html @@ -15,6 +15,10 @@