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_UTILS_H_ | 5 #ifndef UI_EVENTS_EVENT_UTILS_H_ |
6 #define UI_EVENTS_EVENT_UTILS_H_ | 6 #define UI_EVENTS_EVENT_UTILS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #endif | 77 #endif |
78 | 78 |
79 // Returns the KeyboardCode from a native event. | 79 // Returns the KeyboardCode from a native event. |
80 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( | 80 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( |
81 const base::NativeEvent& native_event); | 81 const base::NativeEvent& native_event); |
82 | 82 |
83 // Returns the DOM KeyboardEvent code (physical location in the | 83 // Returns the DOM KeyboardEvent code (physical location in the |
84 // keyboard) from a native event. | 84 // keyboard) from a native event. |
85 EVENTS_EXPORT DomCode CodeFromNative(const base::NativeEvent& native_event); | 85 EVENTS_EXPORT DomCode CodeFromNative(const base::NativeEvent& native_event); |
86 | 86 |
87 // Returns the platform related key code. For X11, it is xksym value. | 87 // Returns the platform related key code (interpretation, not scan code). |
| 88 // For X11 and xkbcommon, it is KeySym value. |
88 EVENTS_EXPORT uint32 PlatformKeycodeFromNative( | 89 EVENTS_EXPORT uint32 PlatformKeycodeFromNative( |
89 const base::NativeEvent& native_event); | 90 const base::NativeEvent& native_event); |
90 | 91 |
91 // Returns a control character sequences from a |windows_key_code|. | |
92 EVENTS_EXPORT base::char16 GetControlCharacterForKeycode(int windows_key_code, | |
93 bool shift); | |
94 | |
95 // Returns true if the keyboard event is a character event rather than | 92 // Returns true if the keyboard event is a character event rather than |
96 // a keystroke event. | 93 // a keystroke event. |
97 EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event); | 94 EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event); |
98 | 95 |
99 // Returns the flags of the button that changed during a press/release. | 96 // Returns the flags of the button that changed during a press/release. |
100 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( | 97 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( |
101 const base::NativeEvent& native_event); | 98 const base::NativeEvent& native_event); |
102 | 99 |
103 // Gets the mouse wheel offsets from a native event. | 100 // Gets the mouse wheel offsets from a native event. |
104 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( | 101 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Update the native X11 event to correspond to the new button flags. | 172 // Update the native X11 event to correspond to the new button flags. |
176 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 173 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
177 #endif | 174 #endif |
178 | 175 |
179 // Registers a custom event type. | 176 // Registers a custom event type. |
180 EVENTS_EXPORT int RegisterCustomEventType(); | 177 EVENTS_EXPORT int RegisterCustomEventType(); |
181 | 178 |
182 } // namespace ui | 179 } // namespace ui |
183 | 180 |
184 #endif // UI_EVENTS_EVENT_UTILS_H_ | 181 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |