| 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, this is the 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // Update the native X11 event to correspond to the new button flags. | 177 // Update the native X11 event to correspond to the new button flags. |
| 181 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 178 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 182 #endif | 179 #endif |
| 183 | 180 |
| 184 // Registers a custom event type. | 181 // Registers a custom event type. |
| 185 EVENTS_EXPORT int RegisterCustomEventType(); | 182 EVENTS_EXPORT int RegisterCustomEventType(); |
| 186 | 183 |
| 187 } // namespace ui | 184 } // namespace ui |
| 188 | 185 |
| 189 #endif // UI_EVENTS_EVENT_UTILS_H_ | 186 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |