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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 85 // Returns the platform related key code. For X11, it is xksym value. |
86 EVENTS_EXPORT uint32 PlatformKeycodeFromNative( | 86 EVENTS_EXPORT uint32 PlatformKeycodeFromNative( |
87 const base::NativeEvent& native_event); | 87 const base::NativeEvent& native_event); |
88 | 88 |
| 89 // Returns true if the keyboard event is a character event rather than |
| 90 // a keystroke event. |
| 91 EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event); |
| 92 |
89 // Returns the flags of the button that changed during a press/release. | 93 // Returns the flags of the button that changed during a press/release. |
90 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( | 94 EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( |
91 const base::NativeEvent& native_event); | 95 const base::NativeEvent& native_event); |
92 | 96 |
93 // Gets the mouse wheel offsets from a native event. | 97 // Gets the mouse wheel offsets from a native event. |
94 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( | 98 EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( |
95 const base::NativeEvent& native_event); | 99 const base::NativeEvent& native_event); |
96 | 100 |
97 // Returns a copy of |native_event|. Depending on the platform, this copy may | 101 // Returns a copy of |native_event|. Depending on the platform, this copy may |
98 // need to be deleted with ReleaseCopiedNativeEvent(). | 102 // need to be deleted with ReleaseCopiedNativeEvent(). |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 166 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
163 | 167 |
164 #endif | 168 #endif |
165 | 169 |
166 // Registers a custom event type. | 170 // Registers a custom event type. |
167 EVENTS_EXPORT int RegisterCustomEventType(); | 171 EVENTS_EXPORT int RegisterCustomEventType(); |
168 | 172 |
169 } // namespace ui | 173 } // namespace ui |
170 | 174 |
171 #endif // UI_EVENTS_EVENT_UTILS_H_ | 175 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |