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