Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 1458203003: MacKeyboard: Don't generate keypress for non-printable char (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Filter more private use characters Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 9621085f36415da1ac97783a5ec242fbe590ffdb..44851cc0745ce1d59b53bad9ef99ebbff56148bd 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -328,12 +328,18 @@ void PlatformKeyboardEventBuilder::setKeyType(Type type)
// which don't have associated character events.
bool PlatformKeyboardEventBuilder::isCharacterKey() const
{
- switch (windowsVirtualKeyCode()) {
- case VKEY_BACK:
- case VKEY_ESCAPE:
+ if (text().length() == 0)
return false;
+
+ UChar32 c = text().characterStartingAt(0);
+ switch (c) {
+ case 0x08: // Backspace
+ case 0x1B: // Escape
+ case 0x7F: // Delete
+ return false;
+ default:
+ return true;
}
- return true;
}
inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type type)

Powered by Google App Engine
This is Rietveld 408576698