From ccf4ed907a2ad95bcbb35925ec9ddf59195605a6 Mon Sep 17 00:00:00 2001 From: Heilig Benedek Date: Mon, 5 Oct 2015 19:11:20 +0200 Subject: [PATCH] Fix some minor bugs related to KeyboardEvent sending --- atom/common/keyboad_util.cc | 7 ++++--- atom/common/native_mate_converters/blink_converter.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/atom/common/keyboad_util.cc b/atom/common/keyboad_util.cc index 1baa829ff74..29d1a800c85 100644 --- a/atom/common/keyboad_util.cc +++ b/atom/common/keyboad_util.cc @@ -10,9 +10,10 @@ namespace atom { ui::KeyboardCode KeyboardCodeFromCharCode(char c, bool* shifted) { *shifted = false; switch (c) { - case 8: case 0x7F: return ui::VKEY_BACK; - case 9: return ui::VKEY_TAB; - case 0xD: case 3: return ui::VKEY_RETURN; + case 0x08: return ui::VKEY_BACK; + case 0x7F: return ui::VKEY_DELETE; + case 0x09: return ui::VKEY_TAB; + case 0x0D: return ui::VKEY_RETURN; case 0x1B: return ui::VKEY_ESCAPE; case ' ': return ui::VKEY_SPACE; diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index 0a599bfdf01..fcfc8905b3e 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -61,7 +61,7 @@ struct Converter { else if (type == "mousewheel") *out = blink::WebInputEvent::MouseWheel; else if (type == "keydown") - *out = blink::WebInputEvent::KeyDown; + *out = blink::WebInputEvent::RawKeyDown; else if (type == "keyup") *out = blink::WebInputEvent::KeyUp; else if (type == "char")