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

Unified Diff: ui/events/event.h

Issue 479873002: Removing X11 native_event uses for key events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 6b8f95c5b15971d8835de724673b2976269bea67..ac147f2589fde4ae34457959cc8468ec405e5741 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -569,7 +569,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// -- character_ is a UTF-16 character value.
// -- key_code_ is conflated with character_ by some code, because both
// arrive in the wParam field of a Windows event.
-// -- code_ is "".
+// -- code_ is the empty string.
//
class EVENTS_EXPORT KeyEvent : public Event {
public:
@@ -612,6 +612,12 @@ class EVENTS_EXPORT KeyEvent : public Event {
// events in an EventRewriter.
void set_key_code(KeyboardCode key_code) { key_code_ = key_code; }
+ // Returns the same value as key_code(), except that located codes are
+ // returned in place of non-located ones (e.g. VKEY_LSHIFT or VKEY_RSHIFT
+ // instead of VKEY_SHIFT). This is a hybrid of semantic and physical
+ // for legacy DOM reasons.
+ KeyboardCode GetLocatedWindowsKeyboardCode() const;
+
// Returns true for [Alt]+<num-pad digit> Unicode alt key codes used by Win.
// TODO(msw): Additional work may be needed for analogues on other platforms.
bool IsUnicodeKeyCode() const;
@@ -635,6 +641,9 @@ class EVENTS_EXPORT KeyEvent : public Event {
void set_is_char(bool is_char) { is_char_ = is_char; }
private:
+ // True if the key press originated from a 'right' key (VKEY_RSHIFT, etc.).
+ bool IsRightSideKey() const;
+
KeyboardCode key_code_;
// String of 'code' defined in DOM KeyboardEvent (e.g. 'KeyA', 'Space')
@@ -657,7 +666,7 @@ class EVENTS_EXPORT KeyEvent : public Event {
// This value represents the text that the key event will insert to input
// field. For key with modifier key, it may have specifial text.
// e.g. CTRL+A has '\x01'.
- base::char16 character_;
+ mutable base::char16 character_;
static bool IsRepeated(const KeyEvent& event);

Powered by Google App Engine
This is Rietveld 408576698