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/event_types.h" | 8 #include "base/event_types.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Returns the KeyboardCode from a native event. | 75 // Returns the KeyboardCode from a native event. |
76 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( | 76 EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( |
77 const base::NativeEvent& native_event); | 77 const base::NativeEvent& native_event); |
78 | 78 |
79 // Returns the DOM KeyboardEvent code (physical location in the | 79 // Returns the DOM KeyboardEvent code (physical location in the |
80 // keyboard) from a native event. The ownership of the return value | 80 // keyboard) from a native event. The ownership of the return value |
81 // is NOT trasferred to the caller. | 81 // is NOT trasferred to the caller. |
82 EVENTS_EXPORT const char* CodeFromNative( | 82 EVENTS_EXPORT const char* CodeFromNative( |
83 const base::NativeEvent& native_event); | 83 const base::NativeEvent& native_event); |
84 | 84 |
| 85 // Returns the platform related key code. For X11, it is xksym value. |
| 86 EVENTS_EXPORT uint32 PlatformKeycodeFromNative( |
| 87 const base::NativeEvent& native_event); |
| 88 |
85 // Returns the flags of the button that changed during a press/release. | 89 // Returns the flags of the button that changed during a press/release. |
86 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( | 90 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( |
87 const base::NativeEvent& native_event); | 91 const base::NativeEvent& native_event); |
88 | 92 |
89 // Gets the mouse wheel offsets from a native event. | 93 // Gets the mouse wheel offsets from a native event. |
90 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( | 94 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( |
91 const base::NativeEvent& native_event); | 95 const base::NativeEvent& native_event); |
92 | 96 |
93 // Returns a copy of |native_event|. Depending on the platform, this copy may | 97 // Returns a copy of |native_event|. Depending on the platform, this copy may |
94 // need to be deleted with ReleaseCopiedNativeEvent(). | 98 // need to be deleted with ReleaseCopiedNativeEvent(). |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
164 | 168 |
165 #endif | 169 #endif |
166 | 170 |
167 // Registers a custom event type. | 171 // Registers a custom event type. |
168 EVENTS_EXPORT int RegisterCustomEventType(); | 172 EVENTS_EXPORT int RegisterCustomEventType(); |
169 | 173 |
170 } // namespace ui | 174 } // namespace ui |
171 | 175 |
172 #endif // UI_EVENTS_EVENT_UTILS_H_ | 176 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |