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

Unified Diff: sky/engine/public/platform/WebInputEvent.h

Issue 872233002: Switch KeyboardEvents over to NewEventHandler (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rename virtualKeyCode to key Created 5 years, 11 months 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
« no previous file with comments | « sky/engine/platform/exported/WebInputEvent.cpp ('k') | sky/engine/public/web/WebFrameClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/public/platform/WebInputEvent.h
diff --git a/sky/engine/public/platform/WebInputEvent.h b/sky/engine/public/platform/WebInputEvent.h
index 5ed33045f6cf258b3a92c2201e8d88c820e21096..bd468004d4697ab04d636a73d04db83fe1f0b8b9 100644
--- a/sky/engine/public/platform/WebInputEvent.h
+++ b/sky/engine/public/platform/WebInputEvent.h
@@ -94,9 +94,8 @@ public:
PointerTypeLast = PointerCancel,
// WebKeyboardEvent
- RawKeyDown,
- KeyboardTypeFirst = RawKeyDown,
KeyDown,
+ KeyboardTypeFirst = KeyDown,
KeyUp,
Char,
KeyboardTypeLast = Char,
@@ -231,16 +230,7 @@ public:
class WebKeyboardEvent : public WebInputEvent {
public:
- // Caps on string lengths so we can make them static arrays and keep
- // them PODs.
- static const size_t textLengthCap = 4;
-
- // http://www.w3.org/TR/DOM-Level-3-Events/keyset.html lists the
- // identifiers. The longest is 18 characters, so we round up to the
- // next multiple of 4.
- static const size_t keyIdentifierLengthCap = 20;
-
- // |windowsKeyCode| is the Windows key code associated with this key
+ // |key| is the Windows key code associated with this key
// event. Sometimes it's direct from the event (i.e. on Windows),
// sometimes it's via a mapping function. If you want a list, see
// WebCore/platform/chromium/KeyboardCodes* . Note that this should
@@ -248,50 +238,21 @@ public:
// what is returned by the Windows API. For example, it should
// store VK_SHIFT instead of VK_RSHIFT. The location information
// should be stored in |modifiers|.
- int windowsKeyCode;
-
- // The actual key code genenerated by the platform. The DOM spec runs
- // on Windows-equivalent codes (thus |windowsKeyCode| above) but it
- // doesn't hurt to have this one around.
- int nativeKeyCode;
-
- // This identifies whether this event was tagged by the system as being
- // a "system key" event (see
- // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for
- // details). Other platforms don't have this concept, but it's just
- // easier to leave it always false than ifdef.
- // See comment at the top of the file for why an int is used here.
- bool isSystemKey;
-
- // |text| is the text generated by this keystroke. |unmodifiedText| is
- // |text|, but unmodified by an concurrently-held modifiers (except
- // shift). This is useful for working out shortcut keys. Linux and
- // Windows guarantee one character per event. The Mac does not, but in
- // reality that's all it ever gives. We're generous, and cap it a bit
- // longer.
- WebUChar text[textLengthCap];
- WebUChar unmodifiedText[textLengthCap];
-
- // This is a string identifying the key pressed.
- char keyIdentifier[keyIdentifierLengthCap];
+ int key;
+
+ // |charCode| is the text generated by this keystroke. |unmodifiedCharCode|
+ // is |charCode|, but unmodified by an concurrently-held modifiers (except
+ // shift). This is useful for working out shortcut keys.
+ WebUChar charCode;
+ WebUChar unmodifiedCharCode;
WebKeyboardEvent()
: WebInputEvent(sizeof(WebKeyboardEvent))
- , windowsKeyCode(0)
- , nativeKeyCode(0)
- , isSystemKey(false)
+ , key(0)
+ , charCode(0)
+ , unmodifiedCharCode(0)
{
- memset(&text, 0, sizeof(text));
- memset(&unmodifiedText, 0, sizeof(unmodifiedText));
- memset(&keyIdentifier, 0, sizeof(keyIdentifier));
}
-
- // Sets keyIdentifier based on the value of windowsKeyCode. This is
- // handy for generating synthetic keyboard events.
- BLINK_EXPORT void setKeyIdentifierFromWindowsKeyCode();
-
- static int windowsKeyCodeWithoutLocation(int keycode);
- static int locationModifiersFromWindowsKeyCode(int keycode);
};
// WebGestureEvent --------------------------------------------------------------
« no previous file with comments | « sky/engine/platform/exported/WebInputEvent.cpp ('k') | sky/engine/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698