only bind up/down in 3 panel mode
This commit is contained in:
parent
ebb373987a
commit
19893d33e3
|
@ -1098,6 +1098,8 @@
|
||||||
return $hotkeys;
|
return $hotkeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// {3} - 3 panel mode only
|
||||||
|
// {C} - combined mode only
|
||||||
function get_hotkeys_map() {
|
function get_hotkeys_map() {
|
||||||
$hotkeys = array(
|
$hotkeys = array(
|
||||||
"k" => "next_feed",
|
"k" => "next_feed",
|
||||||
|
@ -1108,8 +1110,8 @@
|
||||||
"P" => "article_page_up",
|
"P" => "article_page_up",
|
||||||
"*(33)|Shift+PgUp" => "article_page_up",
|
"*(33)|Shift+PgUp" => "article_page_up",
|
||||||
"*(34)|Shift+PgDn" => "article_page_down",
|
"*(34)|Shift+PgDn" => "article_page_down",
|
||||||
"(38)|Up" => "prev_article_or_scroll",
|
"{3}(38)|Up" => "prev_article_or_scroll",
|
||||||
"(40)|Down" => "next_article_or_scroll",
|
"{3}(40)|Down" => "next_article_or_scroll",
|
||||||
"*(38)|Shift+Up" => "article_scroll_up",
|
"*(38)|Shift+Up" => "article_scroll_up",
|
||||||
"*(40)|Shift+Down" => "article_scroll_down",
|
"*(40)|Shift+Down" => "article_scroll_down",
|
||||||
"^(38)|Ctrl+Up" => "prev_article_noscroll",
|
"^(38)|Ctrl+Up" => "prev_article_noscroll",
|
||||||
|
|
|
@ -134,6 +134,17 @@ define(["dojo/_base/declare"], function (declare) {
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
getActionByHotkeySequence: function (sequence) {
|
||||||
|
const hotkeys_map = App.getInitParam("hotkeys");
|
||||||
|
|
||||||
|
for (const seq in hotkeys_map[1]) {
|
||||||
|
if (hotkeys_map[1].hasOwnProperty(seq)) {
|
||||||
|
if (seq == sequence) {
|
||||||
|
return hotkeys_map[1][seq];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
keyeventToAction: function(event) {
|
keyeventToAction: function(event) {
|
||||||
|
|
||||||
const hotkeys_map = App.getInitParam("hotkeys");
|
const hotkeys_map = App.getInitParam("hotkeys");
|
||||||
|
@ -177,18 +188,16 @@ define(["dojo/_base/declare"], function (declare) {
|
||||||
hotkey_name = keychar ? keychar : "(" + keycode + ")";
|
hotkey_name = keychar ? keychar : "(" + keycode + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
const hotkey_full = this.hotkey_prefix ? this.hotkey_prefix + " " + hotkey_name : hotkey_name;
|
let hotkey_full = this.hotkey_prefix ? this.hotkey_prefix + " " + hotkey_name : hotkey_name;
|
||||||
this.hotkey_prefix = false;
|
this.hotkey_prefix = false;
|
||||||
|
|
||||||
let action_name = false;
|
let action_name = this.getActionByHotkeySequence(hotkey_full);
|
||||||
|
|
||||||
for (const sequence in hotkeys_map[1]) {
|
// check for mode-specific hotkey
|
||||||
if (hotkeys_map[1].hasOwnProperty(sequence)) {
|
if (!action_name) {
|
||||||
if (sequence == hotkey_full) {
|
hotkey_full = (App.isCombinedMode() ? "{C}" : "{3}") + hotkey_full;
|
||||||
action_name = hotkeys_map[1][sequence];
|
|
||||||
break;
|
action_name = this.getActionByHotkeySequence(hotkey_full);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('keyeventToAction', hotkey_full, '=>', action_name);
|
console.log('keyeventToAction', hotkey_full, '=>', action_name);
|
||||||
|
|
Loading…
Reference in New Issue