| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
| 6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 // Marks this key event as translated or not translated. | 742 // Marks this key event as translated or not translated. |
| 743 void SetTranslated(bool translated); | 743 void SetTranslated(bool translated); |
| 744 | 744 |
| 745 protected: | 745 protected: |
| 746 friend class KeyEventTestApi; | 746 friend class KeyEventTestApi; |
| 747 | 747 |
| 748 // This allows a subclass TranslatedKeyEvent to be a non character event. | 748 // This allows a subclass TranslatedKeyEvent to be a non character event. |
| 749 void set_is_char(bool is_char) { is_char_ = is_char; } | 749 void set_is_char(bool is_char) { is_char_ = is_char; } |
| 750 | 750 |
| 751 private: | 751 private: |
| 752 // True if the key press originated from a 'right' key (VKEY_RSHIFT, etc.). | |
| 753 bool IsRightSideKey() const; | |
| 754 | |
| 755 // Determine key_ and character_ on a keystroke event from code_ and flags(). | 752 // Determine key_ and character_ on a keystroke event from code_ and flags(). |
| 756 void ApplyLayout() const; | 753 void ApplyLayout() const; |
| 757 | 754 |
| 758 KeyboardCode key_code_; | 755 KeyboardCode key_code_; |
| 759 | 756 |
| 760 // DOM KeyboardEvent |code| (e.g. DomCode::KEY_A, DomCode::SPACE). | 757 // DOM KeyboardEvent |code| (e.g. DomCode::KEY_A, DomCode::SPACE). |
| 761 // http://www.w3.org/TR/DOM-Level-3-Events-code/ | 758 // http://www.w3.org/TR/DOM-Level-3-Events-code/ |
| 762 // | 759 // |
| 763 // This value represents the physical position in the keyboard and can be | 760 // This value represents the physical position in the keyboard and can be |
| 764 // converted from / to keyboard scan code like XKB. | 761 // converted from / to keyboard scan code like XKB. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 871 |
| 875 const GestureEventDetails& details() const { return details_; } | 872 const GestureEventDetails& details() const { return details_; } |
| 876 | 873 |
| 877 private: | 874 private: |
| 878 GestureEventDetails details_; | 875 GestureEventDetails details_; |
| 879 }; | 876 }; |
| 880 | 877 |
| 881 } // namespace ui | 878 } // namespace ui |
| 882 | 879 |
| 883 #endif // UI_EVENTS_EVENT_H_ | 880 #endif // UI_EVENTS_EVENT_H_ |
| OLD | NEW |