support ctrl key hotkeys

This commit is contained in:
Andrew Dolgov 2013-01-22 13:00:20 +04:00
parent e5e2cf3b88
commit 3fb401120a
2 changed files with 5 additions and 6 deletions

View File

@ -2077,10 +2077,11 @@
"g t" => "goto_tagcloud", "g t" => "goto_tagcloud",
"g P" => "goto_prefs", "g P" => "goto_prefs",
// "other" => array( // "other" => array(
"(9)|tab" => "select_article_cursor", // tab "(9)|Tab" => "select_article_cursor", // tab
"c l" => "create_label", "c l" => "create_label",
"c f" => "create_filter", "c f" => "create_filter",
"c s" => "collapse_sidebar", "c s" => "collapse_sidebar",
"^(191)|Ctrl+/" => "help_dialog",
); );
global $pluginhost; global $pluginhost;

View File

@ -645,11 +645,8 @@ function hotkey_handler(e) {
var cmdline = $('cmdline'); var cmdline = $('cmdline');
try { shift_key = e.shiftKey;
shift_key = e.shiftKey; ctrl_key = e.ctrlKey;
} catch (e) {
}
if (window.event) { if (window.event) {
keycode = window.event.keyCode; keycode = window.event.keyCode;
@ -687,6 +684,7 @@ function hotkey_handler(e) {
Element.hide(cmdline); Element.hide(cmdline);
var hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")"; var hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
if (ctrl_key) hotkey = "^" + hotkey;
hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey; hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
hotkey_prefix = false; hotkey_prefix = false;