~ci-train-bot/mir/mir-ubuntu-zesty-2683

« back to all changes in this revision

Viewing changes to 3rd_party/android-deps/android/input.h

  • Committer: Bileto Bot
  • Date: 2017-04-13 15:26:17 UTC
  • mfrom: (1160.2883.164 0.27)
  • Revision ID: ci-train-bot@canonical.com-20170413152617-bs7slz07xbzxu2d3
* New upstream release 0.27.0 (https://launchpad.net/mir/+milestone/0.27.0)
  - ABI summary:
    . mirclient ABI unchanged at 9
    . mirserver ABI bumped to 44
    . mircommon ABI unchanged at 7
    . mirplatform ABI bumped to 61
    . mirprotobuf ABI unchanged at 3
    . mirplatformgraphics ABI bumped to 13
    . mirclientplatform ABI unchanged at 5
    . mirinputplatform ABI bumped to 7
    . mircore ABI unchanged at 1
  - Enhancements:
    . Mostly groundwork required to support major enhancements coming in
      future Mir versions.
    . Removed android-input and eliminated the entire "3rd_party/" subtree.
      Now the Mir source tree contains original code only.
    . Added mir_prompt_session_new_fds_for_prompt_providers_sync API.
    . mirout: Added load and save options for keeping display configs
      on disk.
    . mirout: Added "--" support for applying configuration changes under
      Unity8.
    . Fixed failure of DRM hardware cursor {hide(); show(image);}
    . Added server option: "--cursor software" (MIR_SERVER_CURSOR=software)
    . Added letterboxing/black bars support to the GL renderer in preparation
      for generic output cloning.
    . Added client API for getting the logical size of an output.
    . Migrated MirCookie to use SHA-256.
    . Ensure RealKMSOutputConfiguration stays in sync with actual hardware
      state.
    . Added support for drag-and-drop.
    . Lots of other client API enhancements.
    . Minor clean-ups, optimizations and dead code removal.
  - Bugs fixed:
    . [enhancement] Make able to get version information from client /
      server APIs (LP: #1195540)
    . Touch screen coordinates don't rotate with the screen (LP: #1349660)
    . Subpixel order not included in Mir display information (LP: #1393578)
    . [enhancement] Missing client API for relative surface movement (e.g.
      dragging client-decorated windows) (LP: #1420334) . Mir does not reset
      key states when paused or resumed (modifiers get stuck after VT
      switching) (LP: #1536279)
    . Inconsistent behaviour of Num Lock (LP: #1588237)
    . [ FAILED ] NestedInput.nested_event_filter_receives_keyboard_from_host
      (LP: #1613523)
    . Rotating an output left or right without restarting the
      compositor distorts the image (LP: #1643488)
    . support display scaling slider in unity8 (LP: #1645372)
    . [ FAILED ] NestedInputWithMouse.mouse_pointer_coordinates_in_nested_
      server_are_accumulated (LP: #1646375)
    . [ FAILED ] NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_
      host_server (LP: #1646558)
    . abi_check doesn't check mircore (LP: #1649354)
    . Under Unity8, mir_demo_client_target is distorted and input in the
      wrong place on start-up (LP: #1655804)
    . [testsfail] PromptSessionClientAPI.client_pid_is_associated_with_
      session hangs and times out (LP: #1655929)
    . EDID does not change when hotplugging a monitor (LP: #1660017)
    . [regression] Mir 0.26.0 - spinner loading animation, minimize, maximize
      too fast (LP: #1661072)
    . [regression] Unity8 stutters constantly (like half frame rate) using
      Mir 0.26.0 (LP: #1661128)
    . [regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or
      Ctrl+C in its terminal (deadlock in DefaultInputDeviceHub::add_device)
      (LP: #1661151)
    . [regression] mirout crashes when connecting to unity8 or any nested
      server: [libprotobuf FATAL
      /usr/include/google/protobuf/repeated_field.h:1408] CHECK failed:
      (index) < (current_size_): (LP: #1661163)
    . [ FAILED ] DefaultInputManagerTest.forwards_pause_continue_state_
      changes_to_platform (LP: #1661187)
    . [regression] Segfault on detect_fd_leaks during acceptance tests (in
      DisplayConfiguration/{DisplayFormatSetting,DisplaySubpixelSetting})
      (LP: #1661498)
    . [regression] Nested server segfaults or rapidly logs exceptions when a
      fullscreen client starts [in mir_presentation_chain_set_dropping_mode
      ... std::exception::what: Operation not permitted] (LP: #1661508)
    . [regression] Windowed clients of nested servers are all black
      (LP: #1661521)
    . mir_window_request_persistent_id_sync seg faults when called twice
      (LP: #1661704)
    . mir_acceptance_tests now takes 10 seconds longer (in r4002 compared to
      r4001) (LP: #1662044)
    . Mir graphics platform ABI broke in series 0.26 but sonames never
      changed (LP: #1662455)
    . libmirclient-dev missing build depndency on libmircore-dev
      (LP: #1662942)
    . [regression] mirscreencast hangs during screencast creation
      (LP: #1662997)
    . [regression] Software clients of nested servers with size >=480x480
      are all black in Mir 0.25.0 and later (or stretched and distorted under
      Unity8) (LP: #1663062)
    . mir_window_spec_set_cursor_name() doesn't trigger
      mir::scene::SurfaceObserver::cursor_image_set_to (LP: #1663197)
    . android complaint during mirscreencast of nested server (LP: #1664562)
    . qtubuntu sends wrong text as part of QKeyEvent (LP: #1664610)
    . Mir server crashed with SIGSEGV in
      mir::compositor::TemporaryBuffer::size() called from
      mir::gl::tessellate_renderable_into_rectangle() (LP: #1664760)
    . mirout reports logical size of a rotated display incorrectly
      (LP: #1665271)
    . Nested servers (Unity8) periodically stutter (half frame rate) with
      Mir 0.26.1 (LP: #1666372)
    . If the only surface in a session cannot take focus the server crashes
      (LP: #1667645)
    . [regression] OSK input shaping no longer works correctly (LP: #1669444)
    . GTK window functions `Always on Top, Move and Resize' don't work in
      Mir/Unity8 (LP: #1669524)
    . [regression] mir_proving_server mode hotkeys (Ctrl+Alt+=/-) cause the
      server to segfault (LP: #1669752)
    . Test takes minutes to complete: MediatingDisplayChangerTest.confirmed_
      configuration_doesnt_revert_after_timeout (LP: #1671033)
    . [ FAILED ] PosixRWMutex.prefer_writer_nonrecursive_prevents_writer_
      starvation (Timeout waiting to acquire write lock) (LP: #1671037)
    . [regression] Mixing screen rotation with mode changes makes the image
      squished (LP: #1672269)
    . unity-system-compositor crashed with SIGSEGV in
      libinput_device_config_accel_is_available() from
      libinput_device_config_accel_set_speed() from
      mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
    . Presentation chains should support various Vulkan presentation modes
      (LP: #1673533)
    . Need an extension for GBM buffers to replace
      mir_buffer_get_buffer_package() (LP: #1673534)
    . cross-compile-chroot.sh (to zesty) fails to build [cannot find -ludev]
      due to libudev.so being in a different directory to where libudev.pc
      searches for it (LP: #1674201)
    . Please transition to Boost 1.62 (LP: #1675138)
    . [regression] Mir is assigning the first output ID = 0 (==
      mir_display_output_id_invalid) (LP: #1675331)
    . Mir sending key repeat events continually to nested shell after VT
      switch (causes Unity8 lockup for a while) (LP: #1675357)
    . mirout commands don't work when followed by -- (LP: #1676320)
    . mir_demo_standalone_render_overlays fails to link (LP: #1677239)
    . [regression] doxygen processing for capnproto/protobuf broken
      (LP: #1679248)
    . mir_window_spec_set_cursor_render_surface does not work (LP: #1679836)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2010 The Android Open Source Project
3
 
 *
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
7
 
 *
8
 
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 
 *
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 */
16
 
 
17
 
#ifndef _ANDROID_INPUT_H
18
 
#define _ANDROID_INPUT_H
19
 
 
20
 
/******************************************************************
21
 
 *
22
 
 * IMPORTANT NOTICE:
23
 
 *
24
 
 *   This file is part of Android's set of stable system headers
25
 
 *   exposed by the Android NDK (Native Development Kit).
26
 
 *
27
 
 *   Third-party source AND binary code relies on the definitions
28
 
 *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
29
 
 *
30
 
 *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
31
 
 *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
32
 
 *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
33
 
 *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
34
 
 */
35
 
 
36
 
/*
37
 
 * Structures and functions to receive and process input events in
38
 
 * native code.
39
 
 *
40
 
 * NOTE: These functions MUST be implemented by /system/lib/libui.so
41
 
 */
42
 
 
43
 
#include <stdint.h>
44
 
#include <sys/types.h>
45
 
 
46
 
#ifdef __cplusplus
47
 
extern "C" {
48
 
#endif
49
 
 
50
 
/*
51
 
 * Key states (may be returned by queries about the current state of a
52
 
 * particular key code, scan code or switch).
53
 
 */
54
 
enum {
55
 
    /* The key state is unknown or the requested key itself is not supported. */
56
 
    AKEY_STATE_UNKNOWN = -1,
57
 
 
58
 
    /* The key is up. */
59
 
    AKEY_STATE_UP = 0,
60
 
 
61
 
    /* The key is down. */
62
 
    AKEY_STATE_DOWN = 1,
63
 
 
64
 
    /* The key is down but is a virtual key press that is being emulated by the system. */
65
 
    AKEY_STATE_VIRTUAL = 2
66
 
};
67
 
 
68
 
/*
69
 
 * Meta key / modifer state.
70
 
 */
71
 
enum {
72
 
    /* No meta keys are pressed. */
73
 
    AMETA_NONE = 0,
74
 
 
75
 
    /* This mask is used to check whether one of the ALT meta keys is pressed. */
76
 
    AMETA_ALT_ON = 0x02,
77
 
 
78
 
    /* This mask is used to check whether the left ALT meta key is pressed. */
79
 
    AMETA_ALT_LEFT_ON = 0x10,
80
 
 
81
 
    /* This mask is used to check whether the right ALT meta key is pressed. */
82
 
    AMETA_ALT_RIGHT_ON = 0x20,
83
 
 
84
 
    /* This mask is used to check whether one of the SHIFT meta keys is pressed. */
85
 
    AMETA_SHIFT_ON = 0x01,
86
 
 
87
 
    /* This mask is used to check whether the left SHIFT meta key is pressed. */
88
 
    AMETA_SHIFT_LEFT_ON = 0x40,
89
 
 
90
 
    /* This mask is used to check whether the right SHIFT meta key is pressed. */
91
 
    AMETA_SHIFT_RIGHT_ON = 0x80,
92
 
 
93
 
    /* This mask is used to check whether the SYM meta key is pressed. */
94
 
    AMETA_SYM_ON = 0x04,
95
 
 
96
 
    /* This mask is used to check whether the FUNCTION meta key is pressed. */
97
 
    AMETA_FUNCTION_ON = 0x08,
98
 
 
99
 
    /* This mask is used to check whether one of the CTRL meta keys is pressed. */
100
 
    AMETA_CTRL_ON = 0x1000,
101
 
 
102
 
    /* This mask is used to check whether the left CTRL meta key is pressed. */
103
 
    AMETA_CTRL_LEFT_ON = 0x2000,
104
 
 
105
 
    /* This mask is used to check whether the right CTRL meta key is pressed. */
106
 
    AMETA_CTRL_RIGHT_ON = 0x4000,
107
 
 
108
 
    /* This mask is used to check whether one of the META meta keys is pressed. */
109
 
    AMETA_META_ON = 0x10000,
110
 
 
111
 
    /* This mask is used to check whether the left META meta key is pressed. */
112
 
    AMETA_META_LEFT_ON = 0x20000,
113
 
 
114
 
    /* This mask is used to check whether the right META meta key is pressed. */
115
 
    AMETA_META_RIGHT_ON = 0x40000,
116
 
 
117
 
    /* This mask is used to check whether the CAPS LOCK meta key is on. */
118
 
    AMETA_CAPS_LOCK_ON = 0x100000,
119
 
 
120
 
    /* This mask is used to check whether the NUM LOCK meta key is on. */
121
 
    AMETA_NUM_LOCK_ON = 0x200000,
122
 
 
123
 
    /* This mask is used to check whether the SCROLL LOCK meta key is on. */
124
 
    AMETA_SCROLL_LOCK_ON = 0x400000
125
 
};
126
 
 
127
 
/*
128
 
 * Input events.
129
 
 *
130
 
 * Input events are opaque structures.  Use the provided accessors functions to
131
 
 * read their properties.
132
 
 */
133
 
struct AInputEvent;
134
 
typedef struct AInputEvent AInputEvent;
135
 
 
136
 
/*
137
 
 * Input event types.
138
 
 */
139
 
enum {
140
 
    /* Indicates that the input event is a key event. */
141
 
    AINPUT_EVENT_TYPE_KEY = 1,
142
 
 
143
 
    /* Indicates that the input event is a motion event. */
144
 
    AINPUT_EVENT_TYPE_MOTION = 2,
145
 
 
146
 
    /* Indicates that the event contains a raw buffer. */
147
 
    AINPUT_EVENT_TYPE_BUFFER = 3
148
 
};
149
 
 
150
 
/*
151
 
 * Key event actions.
152
 
 */
153
 
enum {
154
 
    /* The key has been pressed down. */
155
 
    AKEY_EVENT_ACTION_DOWN = 0,
156
 
 
157
 
    /* The key has been released. */
158
 
    AKEY_EVENT_ACTION_UP = 1,
159
 
 
160
 
    /* Multiple duplicate key events have occurred in a row, or a complex string is
161
 
     * being delivered.  The repeat_count property of the key event contains the number
162
 
     * of times the given key code should be executed.
163
 
     */
164
 
    AKEY_EVENT_ACTION_MULTIPLE = 2
165
 
};
166
 
 
167
 
/*
168
 
 * Key event flags.
169
 
 */
170
 
enum {
171
 
    /* This mask is set if the device woke because of this key event. */
172
 
    AKEY_EVENT_FLAG_WOKE_HERE = 0x1,
173
 
 
174
 
    /* This mask is set if the key event was generated by a software keyboard. */
175
 
    AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2,
176
 
 
177
 
    /* This mask is set if we don't want the key event to cause us to leave touch mode. */
178
 
    AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4,
179
 
 
180
 
    /* This mask is set if an event was known to come from a trusted part
181
 
     * of the system.  That is, the event is known to come from the user,
182
 
     * and could not have been spoofed by a third party component. */
183
 
    AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8,
184
 
 
185
 
    /* This mask is used for compatibility, to identify enter keys that are
186
 
     * coming from an IME whose enter key has been auto-labelled "next" or
187
 
     * "done".  This allows TextView to dispatch these as normal enter keys
188
 
     * for old applications, but still do the appropriate action when
189
 
     * receiving them. */
190
 
    AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10,
191
 
 
192
 
    /* When associated with up key events, this indicates that the key press
193
 
     * has been canceled.  Typically this is used with virtual touch screen
194
 
     * keys, where the user can slide from the virtual key area on to the
195
 
     * display: in that case, the application will receive a canceled up
196
 
     * event and should not perform the action normally associated with the
197
 
     * key.  Note that for this to work, the application can not perform an
198
 
     * action for a key until it receives an up or the long press timeout has
199
 
     * expired. */
200
 
    AKEY_EVENT_FLAG_CANCELED = 0x20,
201
 
 
202
 
    /* This key event was generated by a virtual (on-screen) hard key area.
203
 
     * Typically this is an area of the touchscreen, outside of the regular
204
 
     * display, dedicated to "hardware" buttons. */
205
 
    AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40,
206
 
 
207
 
    /* This flag is set for the first key repeat that occurs after the
208
 
     * long press timeout. */
209
 
    AKEY_EVENT_FLAG_LONG_PRESS = 0x80,
210
 
 
211
 
    /* Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
212
 
     * press action was executed while it was down. */
213
 
    AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100,
214
 
 
215
 
    /* Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
216
 
     * tracked from its initial down.  That is, somebody requested that tracking
217
 
     * started on the key down and a long press has not caused
218
 
     * the tracking to be canceled. */
219
 
    AKEY_EVENT_FLAG_TRACKING = 0x200,
220
 
 
221
 
    /* Set when a key event has been synthesized to implement default behavior
222
 
     * for an event that the application did not handle.
223
 
     * Fallback key events are generated by unhandled trackball motions
224
 
     * (to emulate a directional keypad) and by certain unhandled key presses
225
 
     * that are declared in the key map (such as special function numeric keypad
226
 
     * keys when numlock is off). */
227
 
    AKEY_EVENT_FLAG_FALLBACK = 0x400
228
 
};
229
 
 
230
 
/*
231
 
 * Motion event actions.
232
 
 */
233
 
 
234
 
/* Bit shift for the action bits holding the pointer index as
235
 
 * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
236
 
 */
237
 
#define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
238
 
 
239
 
enum {
240
 
    /* Bit mask of the parts of the action code that are the action itself.
241
 
     */
242
 
    AMOTION_EVENT_ACTION_MASK = 0xff,
243
 
 
244
 
    /* Bits in the action code that represent a pointer index, used with
245
 
     * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP.  Shifting
246
 
     * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
247
 
     * index where the data for the pointer going up or down can be found.
248
 
     */
249
 
    AMOTION_EVENT_ACTION_POINTER_INDEX_MASK  = 0xff00,
250
 
 
251
 
    /* A pressed gesture has started, the motion contains the initial starting location.
252
 
     */
253
 
    AMOTION_EVENT_ACTION_DOWN = 0,
254
 
 
255
 
    /* A pressed gesture has finished, the motion contains the final release location
256
 
     * as well as any intermediate points since the last down or move event.
257
 
     */
258
 
    AMOTION_EVENT_ACTION_UP = 1,
259
 
 
260
 
    /* A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
261
 
     * AMOTION_EVENT_ACTION_UP).  The motion contains the most recent point, as well as
262
 
     * any intermediate points since the last down or move event.
263
 
     */
264
 
    AMOTION_EVENT_ACTION_MOVE = 2,
265
 
 
266
 
    /* The current gesture has been aborted.
267
 
     * You will not receive any more points in it.  You should treat this as
268
 
     * an up event, but not perform any action that you normally would.
269
 
     */
270
 
    AMOTION_EVENT_ACTION_CANCEL = 3,
271
 
 
272
 
    /* A movement has happened outside of the normal bounds of the UI element.
273
 
     * This does not provide a full gesture, but only the initial location of the movement/touch.
274
 
     */
275
 
    AMOTION_EVENT_ACTION_OUTSIDE = 4,
276
 
 
277
 
    /* A non-primary pointer has gone down.
278
 
     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
279
 
     */
280
 
    AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
281
 
 
282
 
    /* A non-primary pointer has gone up.
283
 
     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
284
 
     */
285
 
    AMOTION_EVENT_ACTION_POINTER_UP = 6,
286
 
 
287
 
    /* A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE).
288
 
     * The motion contains the most recent point, as well as any intermediate points since
289
 
     * the last hover move event.
290
 
     */
291
 
    AMOTION_EVENT_ACTION_HOVER_MOVE = 7,
292
 
 
293
 
    /* The motion event contains relative vertical and/or horizontal scroll offsets.
294
 
     * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL
295
 
     * and AMOTION_EVENT_AXIS_HSCROLL.
296
 
     * The pointer may or may not be down when this event is dispatched.
297
 
     * This action is always delivered to the winder under the pointer, which
298
 
     * may not be the window currently touched.
299
 
     */
300
 
    AMOTION_EVENT_ACTION_SCROLL = 8,
301
 
 
302
 
    /* The pointer is not down but has entered the boundaries of a window or view.
303
 
     */
304
 
    AMOTION_EVENT_ACTION_HOVER_ENTER = 9,
305
 
 
306
 
    /* The pointer is not down but has exited the boundaries of a window or view.
307
 
     */
308
 
    AMOTION_EVENT_ACTION_HOVER_EXIT = 10
309
 
};
310
 
 
311
 
/*
312
 
 * Motion event flags.
313
 
 */
314
 
enum {
315
 
    /* This flag indicates that the window that received this motion event is partly
316
 
     * or wholly obscured by another visible window above it.  This flag is set to true
317
 
     * even if the event did not directly pass through the obscured area.
318
 
     * A security sensitive application can check this flag to identify situations in which
319
 
     * a malicious application may have covered up part of its content for the purpose
320
 
     * of misleading the user or hijacking touches.  An appropriate response might be
321
 
     * to drop the suspect touches or to take additional precautions to confirm the user's
322
 
     * actual intent.
323
 
     */
324
 
    AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1
325
 
};
326
 
 
327
 
/*
328
 
 * Motion event edge touch flags.
329
 
 */
330
 
enum {
331
 
    /* No edges intersected */
332
 
    AMOTION_EVENT_EDGE_FLAG_NONE = 0,
333
 
 
334
 
    /* Flag indicating the motion event intersected the top edge of the screen. */
335
 
    AMOTION_EVENT_EDGE_FLAG_TOP = 0x01,
336
 
 
337
 
    /* Flag indicating the motion event intersected the bottom edge of the screen. */
338
 
    AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02,
339
 
 
340
 
    /* Flag indicating the motion event intersected the left edge of the screen. */
341
 
    AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04,
342
 
 
343
 
    /* Flag indicating the motion event intersected the right edge of the screen. */
344
 
    AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08
345
 
};
346
 
 
347
 
/*
348
 
 * Constants that identify each individual axis of a motion event.
349
 
 * Refer to the documentation on the MotionEvent class for descriptions of each axis.
350
 
 */
351
 
enum {
352
 
    AMOTION_EVENT_AXIS_X = 0,
353
 
    AMOTION_EVENT_AXIS_Y = 1,
354
 
    AMOTION_EVENT_AXIS_PRESSURE = 2,
355
 
    AMOTION_EVENT_AXIS_SIZE = 3,
356
 
    AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4,
357
 
    AMOTION_EVENT_AXIS_TOUCH_MINOR = 5,
358
 
    AMOTION_EVENT_AXIS_TOOL_MAJOR = 6,
359
 
    AMOTION_EVENT_AXIS_TOOL_MINOR = 7,
360
 
    AMOTION_EVENT_AXIS_ORIENTATION = 8,
361
 
    AMOTION_EVENT_AXIS_VSCROLL = 9,
362
 
    AMOTION_EVENT_AXIS_HSCROLL = 10,
363
 
    AMOTION_EVENT_AXIS_Z = 11,
364
 
    AMOTION_EVENT_AXIS_RX = 12,
365
 
    AMOTION_EVENT_AXIS_RY = 13,
366
 
    AMOTION_EVENT_AXIS_RZ = 14,
367
 
    AMOTION_EVENT_AXIS_HAT_X = 15,
368
 
    AMOTION_EVENT_AXIS_HAT_Y = 16,
369
 
    AMOTION_EVENT_AXIS_LTRIGGER = 17,
370
 
    AMOTION_EVENT_AXIS_RTRIGGER = 18,
371
 
    AMOTION_EVENT_AXIS_THROTTLE = 19,
372
 
    AMOTION_EVENT_AXIS_RUDDER = 20,
373
 
    AMOTION_EVENT_AXIS_WHEEL = 21,
374
 
    AMOTION_EVENT_AXIS_GAS = 22,
375
 
    AMOTION_EVENT_AXIS_BRAKE = 23,
376
 
    AMOTION_EVENT_AXIS_DISTANCE = 24,
377
 
    AMOTION_EVENT_AXIS_TILT = 25,
378
 
    AMOTION_EVENT_AXIS_GENERIC_1 = 32,
379
 
    AMOTION_EVENT_AXIS_GENERIC_2 = 33,
380
 
    AMOTION_EVENT_AXIS_GENERIC_3 = 34,
381
 
    AMOTION_EVENT_AXIS_GENERIC_4 = 35,
382
 
    AMOTION_EVENT_AXIS_GENERIC_5 = 36,
383
 
    AMOTION_EVENT_AXIS_GENERIC_6 = 37,
384
 
    AMOTION_EVENT_AXIS_GENERIC_7 = 38,
385
 
    AMOTION_EVENT_AXIS_GENERIC_8 = 39,
386
 
    AMOTION_EVENT_AXIS_GENERIC_9 = 40,
387
 
    AMOTION_EVENT_AXIS_GENERIC_10 = 41,
388
 
    AMOTION_EVENT_AXIS_GENERIC_11 = 42,
389
 
    AMOTION_EVENT_AXIS_GENERIC_12 = 43,
390
 
    AMOTION_EVENT_AXIS_GENERIC_13 = 44,
391
 
    AMOTION_EVENT_AXIS_GENERIC_14 = 45,
392
 
    AMOTION_EVENT_AXIS_GENERIC_15 = 46,
393
 
    AMOTION_EVENT_AXIS_GENERIC_16 = 47
394
 
 
395
 
    // NOTE: If you add a new axis here you must also add it to several other files.
396
 
    //       Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.
397
 
};
398
 
 
399
 
/*
400
 
 * Constants that identify buttons that are associated with motion events.
401
 
 * Refer to the documentation on the MotionEvent class for descriptions of each button.
402
 
 */
403
 
enum {
404
 
    AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0,
405
 
    AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1,
406
 
    AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2,
407
 
    AMOTION_EVENT_BUTTON_BACK = 1 << 3,
408
 
    AMOTION_EVENT_BUTTON_FORWARD = 1 << 4
409
 
};
410
 
 
411
 
/*
412
 
 * Constants that identify tool types.
413
 
 * Refer to the documentation on the MotionEvent class for descriptions of each tool type.
414
 
 */
415
 
enum {
416
 
    AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0,
417
 
    AMOTION_EVENT_TOOL_TYPE_FINGER = 1,
418
 
    AMOTION_EVENT_TOOL_TYPE_STYLUS = 2,
419
 
    AMOTION_EVENT_TOOL_TYPE_MOUSE = 3,
420
 
    AMOTION_EVENT_TOOL_TYPE_ERASER = 4
421
 
};
422
 
 
423
 
/*
424
 
 * Input sources.
425
 
 *
426
 
 * Refer to the documentation on android.view.InputDevice for more details about input sources
427
 
 * and their correct interpretation.
428
 
 */
429
 
enum {
430
 
    AINPUT_SOURCE_CLASS_MASK = 0x000000ff,
431
 
 
432
 
    AINPUT_SOURCE_CLASS_BUTTON = 0x00000001,
433
 
    AINPUT_SOURCE_CLASS_POINTER = 0x00000002,
434
 
    AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004,
435
 
    AINPUT_SOURCE_CLASS_POSITION = 0x00000008,
436
 
    AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010
437
 
};
438
 
 
439
 
enum {
440
 
    AINPUT_SOURCE_UNKNOWN = 0x00000000,
441
 
 
442
 
    AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON,
443
 
    AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON,
444
 
    AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON,
445
 
    AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER,
446
 
    AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER,
447
 
    AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER,
448
 
    AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
449
 
    AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
450
 
    AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK,
451
 
 
452
 
    AINPUT_SOURCE_ANY = 0xffffff00
453
 
};
454
 
 
455
 
/*
456
 
 * Keyboard types.
457
 
 *
458
 
 * Refer to the documentation on android.view.InputDevice for more details.
459
 
 */
460
 
enum {
461
 
    AINPUT_KEYBOARD_TYPE_NONE = 0,
462
 
    AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
463
 
    AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2
464
 
};
465
 
 
466
 
#ifdef __cplusplus
467
 
}
468
 
#endif
469
 
 
470
 
#endif // _ANDROID_INPUT_H