Check e.which on hotkey events for charCode != 0

"(" and "↓" share the same e.which, but only "(" has a non-zero
charCode. This commit will start checking for non-zero charCodes
for directional keys.

(imported from commit bcb8c3c5ef2c13708fd04cca5f4d8b0f65beaa84)
This commit is contained in:
acrefoot 2013-06-10 11:08:00 -04:00
parent f4132ace48
commit b27bb3fc33
1 changed files with 5 additions and 2 deletions

View File

@ -33,6 +33,8 @@ var narrow_hotkeys = {
// Returns true if we handled it, false if the browser should.
function process_hotkey(e) {
var code = e.which;
var charCode = e.charCode;
var next_row, dirkey;
// Disable hotkeys on settings page etc., and when a modal pop-up
@ -90,6 +92,7 @@ function process_hotkey(e) {
}
if (arrow_keys.hasOwnProperty(code)
&& charCode === 0
&& compose.composing()
&& compose.message_content() === "") {
compose.cancel();
@ -112,7 +115,7 @@ function process_hotkey(e) {
return false;
}
if (directional_hotkeys_id.hasOwnProperty(code)) {
if (directional_hotkeys_id.hasOwnProperty(code) && charCode === 0) {
if (current_msg_list.empty()) {
return false;
}
@ -124,7 +127,7 @@ function process_hotkey(e) {
return true;
}
if (directional_hotkeys.hasOwnProperty(code)) {
if (directional_hotkeys.hasOwnProperty(code) && charCode === 0) {
if (current_msg_list.empty()) {
return false;
}