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

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: erikchen and dtapuska's review 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 547a598111bd370a9c6dd27add8f1f0def382a93..a83ffbe51593913e66942a28e750fcb9147e242e 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -328,17 +328,20 @@ void PlatformKeyboardEventBuilder::setKeyType(Type type)
}
}
-// Please refer to bug http://b/issue?id=961192, which talks about Webkit
-// keyboard event handling changes. It also mentions the list of keys
-// 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