event_utils.h revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#ifndef UI_EVENTS_EVENT_UTILS_H_
6d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#define UI_EVENTS_EVENT_UTILS_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/event_types.h"
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "base/memory/scoped_ptr.h"
10d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ui/events/event_constants.h"
11d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#include "ui/events/keycodes/keyboard_codes.h"
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/gfx/display.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h"
1468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)#include "ui/events/events_export.h"
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <windows.h>
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace gfx {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Point;
22c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class Vector2d;
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace base {
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class TimeDelta;
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ui {
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Event;
325f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)class MouseEvent;
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Updates the list of devices for cached properties.
3568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT void UpdateDeviceList();
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
37cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Returns a ui::Event wrapping a native event. Ownership of the returned value
38cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// is transferred to the caller.
39cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)EVENTS_EXPORT scoped_ptr<Event> EventFromNative(
40cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)    const base::NativeEvent& native_event);
41cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the EventType from a native event.
4368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT EventType EventTypeFromNative(
4468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)    const base::NativeEvent& native_event);
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the EventFlags from a native event.
4768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event);
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Get the timestamp from a native event.
5068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT base::TimeDelta EventTimeFromNative(
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::NativeEvent& native_event);
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Create a timestamp based on the current time.
5468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT base::TimeDelta EventTimeForNow();
552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Get the location from a native event.  The coordinate system of the resultant
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |Point| has the origin at top-left of the "root window".  The nature of
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// this "root window" and how it maps to platform-specific drawing surfaces is
595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// defined in ui/aura/root_window.* and ui/aura/window_tree_host*.
605d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// TODO(tdresser): Return gfx::PointF here. See crbug.com/337827.
6168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT gfx::Point EventLocationFromNative(
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::NativeEvent& native_event);
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the location in native system coordinate space.
6568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT gfx::Point EventSystemLocationFromNative(
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::NativeEvent& native_event);
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(USE_X11)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the 'real' button for an event. The button reported in slave events
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// does not take into account any remapping (e.g. using xmodmap), while the
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// button reported in master events do. This is a utility function to always
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// return the mapped button.
7368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event);
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the KeyboardCode from a native event.
7768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative(
785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::NativeEvent& native_event);
795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
80a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Returns the DOM KeyboardEvent code (physical location in the
81a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// keyboard) from a native event.  The ownership of the return value
82a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// is NOT trasferred to the caller.
83a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)EVENTS_EXPORT const char* CodeFromNative(
84a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)    const base::NativeEvent& native_event);
85a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
86f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)// Returns the platform related key code. For X11, it is xksym value.
87f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)EVENTS_EXPORT uint32 PlatformKeycodeFromNative(
88f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)    const base::NativeEvent& native_event);
89f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
9003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// Returns the windows key code. Note that this value is different from
9103b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// KeyboardCodeFromNative (there is a divergence between ui::KeyboardCode and
9203b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// windows key codes).
9303b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)EVENTS_EXPORT uint32 WindowsKeycodeFromNative(
9403b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)    const base::NativeEvent& native_event);
9503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)
9603b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// Returns the text generated by this keystroke. Used in the value we pass to
9703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// blink.
9803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)EVENTS_EXPORT uint16 TextFromNative(const base::NativeEvent& native_event);
9903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)
10003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// Returns the unmodified text generated by this keystroke. Used in the value
10103b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// we pass to blink.
10203b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)EVENTS_EXPORT uint16 UnmodifiedTextFromNative(
10303b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)    const base::NativeEvent& native_event);
10403b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)
10503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#if defined(OS_LINUX)
10603b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)// Returns a control character sequences from a |windows_key_code|.
10703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)EVENTS_EXPORT uint16 GetControlCharacterForKeycode(int windows_key_code,
10803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                                   bool shift);
10903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)#endif
11003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)
1115f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Returns true if the keyboard event is a character event rather than
1125f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// a keystroke event.
1135f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)EVENTS_EXPORT bool IsCharFromNative(const base::NativeEvent& native_event);
1145f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns the flags of the button that changed during a press/release.
11668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative(
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::NativeEvent& native_event);
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
119c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Gets the mouse wheel offsets from a native event.
12068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset(
121c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    const base::NativeEvent& native_event);
1225c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu
1235c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Returns a copy of |native_event|. Depending on the platform, this copy may
1245c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// need to be deleted with ReleaseCopiedNativeEvent().
1255c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liubase::NativeEvent CopyNativeEvent(
1265c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu    const base::NativeEvent& native_event);
1275c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu
1285c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Delete a |native_event| previously created by CopyNativeEvent().
1295c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liuvoid ReleaseCopiedNativeEvent(
1305c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu    const base::NativeEvent& native_event);
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the touch id from a native event.
13368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event);
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1355f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Increases the number of times |ClearTouchIdIfReleased| needs to be called on
1365f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// an event with a given touch id before it will actually be cleared.
1375f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)EVENTS_EXPORT void IncrementTouchIdRefCount(
1385f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)    const base::NativeEvent& native_event);
1395f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
140a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)// Clear the touch id from bookkeeping if it is a release/cancel event.
14168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT void ClearTouchIdIfReleased(
14268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)    const base::NativeEvent& native_event);
143a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles)
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the radius along the X/Y axis from a native event. Default is 1.0.
14568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event);
14668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event);
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the angle of the major axis away from the X axis. Default is 0.0.
14968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event);
1505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0.
15268043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT float GetTouchForce(const base::NativeEvent& native_event);
1535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Gets the fling velocity from a native event. is_cancel is set to true if
1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// this was a tap down, intended to stop an ongoing fling.
15668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT bool GetFlingData(const base::NativeEvent& native_event,
15703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                float* vx,
15803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                float* vy,
15903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                float* vx_ordinal,
16003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                float* vy_ordinal,
16103b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                bool* is_cancel);
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns whether this is a scroll event and optionally gets the amount to be
1642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL.
16568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event,
16603b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                    float* x_offset,
16703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                    float* y_offset,
16803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                    float* x_offset_ordinal,
16903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                    float* y_offset_ordinal,
17003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)                                    int* finger_count);
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)// Returns whether natural scrolling should be used for touchpad.
1731e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)EVENTS_EXPORT bool ShouldDefaultToNaturalScroll();
1741e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)
1755d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Returns whether or not the internal display produces touch events.
1765d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport();
1775d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
17968043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel);
18068043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int GetModifiersFromKeyState();
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns true if |message| identifies a mouse event that was generated as the
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// result of a touch event.
18468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message);
185a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
186a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Converts scan code and lParam each other.  The scan code
187a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// representing an extended key contains 0xE000 bits.
188a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam);
189a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code);
19046d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1935f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#if defined(USE_X11)
1945f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Update the native X11 event to correspond to the new flags.
1955f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)EVENTS_EXPORT void UpdateX11EventForFlags(Event* event);
1965f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)// Update the native X11 event to correspond to the new button flags.
1975f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event);
1985f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#endif
1995f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)
2002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Registers a custom event type.
20168043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)EVENTS_EXPORT int RegisterCustomEventType();
2022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace ui
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205d0247b1b59f9c528cb6df88b4f2b9afaf80d181eTorne (Richard Coles)#endif  // UI_EVENTS_EVENT_UTILS_H_
206