1e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/*
2e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Copyright (C) 2010 The Android Open Source Project
3e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
4e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
5e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * you may not use this file except in compliance with the License.
6e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * You may obtain a copy of the License at
7e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
8e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
9e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
10e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Unless required by applicable law or agreed to in writing, software
11e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
12e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * See the License for the specific language governing permissions and
14e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * limitations under the License.
15e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
16e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
17bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
18bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * @addtogroup Input
19bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * @{
20bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
21bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine
22bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
23bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * @file input.h
24bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
25bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine
26e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#ifndef _ANDROID_INPUT_H
27e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#define _ANDROID_INPUT_H
28e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
29494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#include <sys/cdefs.h>
30494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert
31e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/******************************************************************
32e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
33e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * IMPORTANT NOTICE:
34e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
35e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   This file is part of Android's set of stable system headers
36e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   exposed by the Android NDK (Native Development Kit).
37e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
38e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   Third-party source AND binary code relies on the definitions
39e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
40e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
41e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
42e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
43e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
44e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
45e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
46e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
47e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/*
48e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Structures and functions to receive and process input events in
49e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * native code.
50e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
51e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * NOTE: These functions MUST be implemented by /system/lib/libui.so
52e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
53e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
54e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#include <stdint.h>
55e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#include <sys/types.h>
56e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#include <android/keycodes.h>
57e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#include <android/looper.h>
58e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
59e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#ifdef __cplusplus
60e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianextern "C" {
61e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#endif
62e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
63bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
64e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Key states (may be returned by queries about the current state of a
65e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * particular key code, scan code or switch).
66e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
67e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
68bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key state is unknown or the requested key itself is not supported. */
69e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_STATE_UNKNOWN = -1,
70e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
71bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key is up. */
72e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_STATE_UP = 0,
73e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
74bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key is down. */
75e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_STATE_DOWN = 1,
76e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
77bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key is down but is a virtual key press that is being emulated by the system. */
78e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_STATE_VIRTUAL = 2
79e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
80e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
81bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
82e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Meta key / modifer state.
83e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
84e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
85bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** No meta keys are pressed. */
86e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_NONE = 0,
87e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
88bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether one of the ALT meta keys is pressed. */
89e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_ALT_ON = 0x02,
90e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
91bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the left ALT meta key is pressed. */
92e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_ALT_LEFT_ON = 0x10,
93e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
94bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the right ALT meta key is pressed. */
95e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_ALT_RIGHT_ON = 0x20,
96e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
97bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether one of the SHIFT meta keys is pressed. */
98e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_SHIFT_ON = 0x01,
99e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
100bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the left SHIFT meta key is pressed. */
101e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_SHIFT_LEFT_ON = 0x40,
102e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
103bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the right SHIFT meta key is pressed. */
104e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_SHIFT_RIGHT_ON = 0x80,
105e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
106bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the SYM meta key is pressed. */
107e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_SYM_ON = 0x04,
108e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
109bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the FUNCTION meta key is pressed. */
110e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_FUNCTION_ON = 0x08,
111e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
112bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether one of the CTRL meta keys is pressed. */
113e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_CTRL_ON = 0x1000,
114e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
115bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the left CTRL meta key is pressed. */
116e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_CTRL_LEFT_ON = 0x2000,
117e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
118bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the right CTRL meta key is pressed. */
119e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_CTRL_RIGHT_ON = 0x4000,
120e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
121bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether one of the META meta keys is pressed. */
122e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_META_ON = 0x10000,
123e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
124bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the left META meta key is pressed. */
125e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_META_LEFT_ON = 0x20000,
126e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
127bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the right META meta key is pressed. */
128e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_META_RIGHT_ON = 0x40000,
129e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
130bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the CAPS LOCK meta key is on. */
131e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_CAPS_LOCK_ON = 0x100000,
132e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
133bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the NUM LOCK meta key is on. */
134e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_NUM_LOCK_ON = 0x200000,
135e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
136bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is used to check whether the SCROLL LOCK meta key is on. */
137e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMETA_SCROLL_LOCK_ON = 0x400000,
138e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
139e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
140bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosinestruct AInputEvent;
141bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
142e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input events.
143e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
144e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input events are opaque structures.  Use the provided accessors functions to
145e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * read their properties.
146e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
147e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopiantypedef struct AInputEvent AInputEvent;
148e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
149bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
150e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input event types.
151e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
152e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
153bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Indicates that the input event is a key event. */
154e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_EVENT_TYPE_KEY = 1,
155e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
156bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Indicates that the input event is a motion event. */
157e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_EVENT_TYPE_MOTION = 2
158e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
159e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
160bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
161e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Key event actions.
162e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
163e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
164bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key has been pressed down. */
165e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_ACTION_DOWN = 0,
166e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
167bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The key has been released. */
168e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_ACTION_UP = 1,
169e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
170bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
171bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Multiple duplicate key events have occurred in a row, or a
172bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * complex string is being delivered.  The repeat_count property
173bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * of the key event contains the number of times the given key
174bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * code should be executed.
175e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
176e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_ACTION_MULTIPLE = 2
177e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
178e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
179bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
180e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Key event flags.
181e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
182e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
183bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is set if the device woke because of this key event. */
184e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_WOKE_HERE = 0x1,
185e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
186bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is set if the key event was generated by a software keyboard. */
187e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2,
188e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
189bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** This mask is set if we don't want the key event to cause us to leave touch mode. */
190e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4,
191e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
192bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
193bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This mask is set if an event was known to come from a trusted
194bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * part of the system.  That is, the event is known to come from
195bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * the user, and could not have been spoofed by a third party
196bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * component.
197bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
198e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8,
199e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
200bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
201bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This mask is used for compatibility, to identify enter keys that are
202e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * coming from an IME whose enter key has been auto-labelled "next" or
203e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * "done".  This allows TextView to dispatch these as normal enter keys
204e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * for old applications, but still do the appropriate action when
205bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * receiving them.
206bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
207e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10,
208e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
209bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
210bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * When associated with up key events, this indicates that the key press
211e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * has been canceled.  Typically this is used with virtual touch screen
212e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * keys, where the user can slide from the virtual key area on to the
213e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * display: in that case, the application will receive a canceled up
214e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * event and should not perform the action normally associated with the
215e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * key.  Note that for this to work, the application can not perform an
216e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * action for a key until it receives an up or the long press timeout has
217bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * expired.
218bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
219e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_CANCELED = 0x20,
220e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
221bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
222bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This key event was generated by a virtual (on-screen) hard key area.
223e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * Typically this is an area of the touchscreen, outside of the regular
224bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * display, dedicated to "hardware" buttons.
225bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
226e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40,
227e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
228bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
229bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This flag is set for the first key repeat that occurs after the
230bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * long press timeout.
231bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
232e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_LONG_PRESS = 0x80,
233e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
234bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
235bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
236bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * press action was executed while it was down.
237bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
238e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100,
239e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
240bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
241bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
242e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * tracked from its initial down.  That is, somebody requested that tracking
243e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * started on the key down and a long press has not caused
244bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * the tracking to be canceled.
245bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
246e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_TRACKING = 0x200,
247e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
248bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
249bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Set when a key event has been synthesized to implement default behavior
250e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * for an event that the application did not handle.
251e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * Fallback key events are generated by unhandled trackball motions
252e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * (to emulate a directional keypad) and by certain unhandled key presses
253e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * that are declared in the key map (such as special function numeric keypad
254bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * keys when numlock is off).
255bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
256e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AKEY_EVENT_FLAG_FALLBACK = 0x400,
257e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
258e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
259bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
260bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Bit shift for the action bits holding the pointer index as
261e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
262e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
263e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
264e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
265bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Motion event actions */
266e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
267bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Bit mask of the parts of the action code that are the action itself. */
268e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_MASK = 0xff,
269e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
270bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
271bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Bits in the action code that represent a pointer index, used with
272e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP.  Shifting
273e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
274e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * index where the data for the pointer going up or down can be found.
275e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
276e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_POINTER_INDEX_MASK  = 0xff00,
277e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
278bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** A pressed gesture has started, the motion contains the initial starting location. */
279e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_DOWN = 0,
280e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
281bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
282bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A pressed gesture has finished, the motion contains the final release location
283e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * as well as any intermediate points since the last down or move event.
284e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
285e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_UP = 1,
286e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
287bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
288bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
289e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * AMOTION_EVENT_ACTION_UP).  The motion contains the most recent point, as well as
290e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * any intermediate points since the last down or move event.
291e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
292e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_MOVE = 2,
293e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
294bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
295bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The current gesture has been aborted.
296e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * You will not receive any more points in it.  You should treat this as
297e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * an up event, but not perform any action that you normally would.
298e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
299e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_CANCEL = 3,
300e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
301bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
302bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A movement has happened outside of the normal bounds of the UI element.
303e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * This does not provide a full gesture, but only the initial location of the movement/touch.
304e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
305e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_OUTSIDE = 4,
306e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
307bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
308bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A non-primary pointer has gone down.
309e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
310e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
311e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
312e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
313bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
314bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A non-primary pointer has gone up.
315e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
316e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
317e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_POINTER_UP = 6,
318e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
319bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
320bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE).
321e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * The motion contains the most recent point, as well as any intermediate points since
322e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * the last hover move event.
323e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
324e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_HOVER_MOVE = 7,
325e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
326bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
327bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The motion event contains relative vertical and/or horizontal scroll offsets.
328e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL
329e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * and AMOTION_EVENT_AXIS_HSCROLL.
330e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * The pointer may or may not be down when this event is dispatched.
331e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * This action is always delivered to the winder under the pointer, which
332e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * may not be the window currently touched.
333e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
334e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_SCROLL = 8,
335e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
336bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The pointer is not down but has entered the boundaries of a window or view. */
337e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_HOVER_ENTER = 9,
338e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
339bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** The pointer is not down but has exited the boundaries of a window or view. */
340e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_ACTION_HOVER_EXIT = 10,
3417b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright
3427b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    /* One or more buttons have been pressed. */
3437b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    AMOTION_EVENT_ACTION_BUTTON_PRESS = 11,
3447b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright
3457b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    /* One or more buttons have been released. */
3467b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    AMOTION_EVENT_ACTION_BUTTON_RELEASE = 12,
347e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
348e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
349bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
350e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Motion event flags.
351e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
352e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
353bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
354bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This flag indicates that the window that received this motion event is partly
355e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * or wholly obscured by another visible window above it.  This flag is set to true
356e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * even if the event did not directly pass through the obscured area.
357e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * A security sensitive application can check this flag to identify situations in which
358e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * a malicious application may have covered up part of its content for the purpose
359e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * of misleading the user or hijacking touches.  An appropriate response might be
360e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * to drop the suspect touches or to take additional precautions to confirm the user's
361e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     * actual intent.
362e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian     */
363e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1,
364e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
365e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
366bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
367e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Motion event edge touch flags.
368e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
369e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
370bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** No edges intersected. */
371e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_EDGE_FLAG_NONE = 0,
372e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
373bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Flag indicating the motion event intersected the top edge of the screen. */
374e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_EDGE_FLAG_TOP = 0x01,
375e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
376bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Flag indicating the motion event intersected the bottom edge of the screen. */
377e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02,
378e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
379bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Flag indicating the motion event intersected the left edge of the screen. */
380e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04,
381e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
382bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** Flag indicating the motion event intersected the right edge of the screen. */
383e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08
384e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
385e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
386bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
387e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Constants that identify each individual axis of a motion event.
388bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * @anchor AMOTION_EVENT_AXIS
389e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
390e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
391bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
392bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: X axis of a motion event.
393bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
394bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the absolute X screen position of the center of
395bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * the touch contact area.  The units are display pixels.
396bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the absolute X surface position of the center of the touch
397bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * contact area. The units are device-dependent.
398bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a mouse, reports the absolute X screen position of the mouse pointer.
399bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are display pixels.
400bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a trackball, reports the relative horizontal displacement of the trackball.
401bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (left) to 1.0 (right).
402bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute X position of the joystick.
403bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (left) to 1.0 (right).
404bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
405e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_X = 0,
406bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
407bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Y axis of a motion event.
408bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
409bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the absolute Y screen position of the center of
410bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * the touch contact area.  The units are display pixels.
411bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the absolute Y surface position of the center of the touch
412bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * contact area. The units are device-dependent.
413bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a mouse, reports the absolute Y screen position of the mouse pointer.
414bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are display pixels.
415bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a trackball, reports the relative vertical displacement of the trackball.
416bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (up) to 1.0 (down).
417bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute Y position of the joystick.
418bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (up or far) to 1.0 (down or near).
419bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
420e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_Y = 1,
421bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
422bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Pressure axis of a motion event.
423bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
424bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen or touch pad, reports the approximate pressure applied to the surface
425bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * by a finger or other tool.  The value is normalized to a range from
426bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * 0 (no pressure at all) to 1 (normal pressure), although values higher than 1
427bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * may be generated depending on the calibration of the input device.
428bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a trackball, the value is set to 1 if the trackball button is pressed
429bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * or 0 otherwise.
430bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a mouse, the value is set to 1 if the primary mouse button is pressed
431bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * or 0 otherwise.
432bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
433e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_PRESSURE = 2,
434bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
435bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Size axis of a motion event.
436bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
437bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen or touch pad, reports the approximate size of the contact area in
438bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * relation to the maximum detectable size for the device.  The value is normalized
439bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * to a range from 0 (smallest detectable size) to 1 (largest detectable size),
440bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * although it is not a linear scale. This value is of limited use.
441bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * To obtain calibrated size information, see
442bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * {@link AMOTION_EVENT_AXIS_TOUCH_MAJOR} or {@link AMOTION_EVENT_AXIS_TOOL_MAJOR}.
443bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
444e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_SIZE = 3,
445bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
446bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: TouchMajor axis of a motion event.
447bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
448bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the length of the major axis of an ellipse that
449bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the touch area at the point of contact.
450bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are display pixels.
451bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the length of the major axis of an ellipse that
452bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the touch area at the point of contact.
453bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are device-dependent.
454bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
455e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4,
456bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
457bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: TouchMinor axis of a motion event.
458bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
459bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the length of the minor axis of an ellipse that
460bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the touch area at the point of contact.
461bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are display pixels.
462bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the length of the minor axis of an ellipse that
463bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the touch area at the point of contact.
464bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are device-dependent.
465bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
466bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * When the touch is circular, the major and minor axis lengths will be equal to one another.
467bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
468e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_TOUCH_MINOR = 5,
469bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
470bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: ToolMajor axis of a motion event.
471bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
472bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the length of the major axis of an ellipse that
473bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the size of the approaching finger or tool used to make contact.
474bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the length of the major axis of an ellipse that
475bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the size of the approaching finger or tool used to make contact.
476bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are device-dependent.
477bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
478bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * When the touch is circular, the major and minor axis lengths will be equal to one another.
479bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
480bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The tool size may be larger than the touch size since the tool may not be fully
481bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * in contact with the touch sensor.
482bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
483e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_TOOL_MAJOR = 6,
484bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
485bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: ToolMinor axis of a motion event.
486bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
487bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen, reports the length of the minor axis of an ellipse that
488bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the size of the approaching finger or tool used to make contact.
489bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch pad, reports the length of the minor axis of an ellipse that
490bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * represents the size of the approaching finger or tool used to make contact.
491bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The units are device-dependent.
492bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
493bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * When the touch is circular, the major and minor axis lengths will be equal to one another.
494bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
495bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The tool size may be larger than the touch size since the tool may not be fully
496bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * in contact with the touch sensor.
497bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
498e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_TOOL_MINOR = 7,
499bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
500bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Orientation axis of a motion event.
501bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
502bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a touch screen or touch pad, reports the orientation of the finger
503bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * or tool in radians relative to the vertical plane of the device.
504bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * An angle of 0 radians indicates that the major axis of contact is oriented
505bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * upwards, is perfectly circular or is of unknown orientation.  A positive angle
506bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * indicates that the major axis of contact is oriented to the right.  A negative angle
507bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * indicates that the major axis of contact is oriented to the left.
508bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
509bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * (finger pointing fully right).
510bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a stylus, the orientation indicates the direction in which the stylus
511bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * is pointing in relation to the vertical axis of the current orientation of the screen.
512bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The range is from -PI radians to PI radians, where 0 is pointing up,
513bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * -PI/2 radians is pointing left, -PI or PI radians is pointing down, and PI/2 radians
514bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * is pointing right.  See also {@link AMOTION_EVENT_AXIS_TILT}.
515bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
516e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_ORIENTATION = 8,
517bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
518bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Vertical Scroll axis of a motion event.
519bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
520bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a mouse, reports the relative movement of the vertical scroll wheel.
521bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (down) to 1.0 (up).
522bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
523bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This axis should be used to scroll views vertically.
524bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
525e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_VSCROLL = 9,
526bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
527bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Horizontal Scroll axis of a motion event.
528bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
529bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a mouse, reports the relative movement of the horizontal scroll wheel.
530bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (left) to 1.0 (right).
531bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
532bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * This axis should be used to scroll views horizontally.
533bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
534e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_HSCROLL = 10,
535bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
536bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Z axis of a motion event.
537bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
538bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute Z position of the joystick.
539bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (high) to 1.0 (low).
540bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * <em>On game pads with two analog joysticks, this axis is often reinterpreted
541bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * to report the absolute X position of the second joystick instead.</em>
542bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
543e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_Z = 11,
544bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
545bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: X Rotation axis of a motion event.
546bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
547bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute rotation angle about the X axis.
548bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
549bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
550e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_RX = 12,
551bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
552bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Y Rotation axis of a motion event.
553bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
554bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute rotation angle about the Y axis.
555bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
556bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
557e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_RY = 13,
558bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
559bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Z Rotation axis of a motion event.
560bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
561bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute rotation angle about the Z axis.
562bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
563bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * On game pads with two analog joysticks, this axis is often reinterpreted
564bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * to report the absolute Y position of the second joystick instead.
565bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
566e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_RZ = 14,
567bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
568bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Hat X axis of a motion event.
569bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
570bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute X position of the directional hat control.
571bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (left) to 1.0 (right).
572bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
573e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_HAT_X = 15,
574bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
575bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Hat Y axis of a motion event.
576bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
577bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute Y position of the directional hat control.
578bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (up) to 1.0 (down).
579bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
580e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_HAT_Y = 16,
581bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
582bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Left Trigger axis of a motion event.
583bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
584bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the left trigger control.
585bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed).
586bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
587e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_LTRIGGER = 17,
588bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
589bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Right Trigger axis of a motion event.
590bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
591bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the right trigger control.
592bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed).
593bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
594e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_RTRIGGER = 18,
595bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
596bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Throttle axis of a motion event.
597bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
598bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the throttle control.
599bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from 0.0 (fully open) to 1.0 (fully closed).
600bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
601e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_THROTTLE = 19,
602bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
603bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Rudder axis of a motion event.
604bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
605bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the rudder control.
606bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right).
607bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
608e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_RUDDER = 20,
609bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
610bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Wheel axis of a motion event.
611bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
612bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the steering wheel control.
613bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right).
614bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
615e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_WHEEL = 21,
616bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
617bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Gas axis of a motion event.
618bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
619bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the gas (accelerator) control.
620bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from 0.0 (no acceleration)
621bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * to 1.0 (maximum acceleration).
622bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
623e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GAS = 22,
624bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
625bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Brake axis of a motion event.
626bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
627bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a joystick, reports the absolute position of the brake control.
628bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The value is normalized to a range from 0.0 (no braking) to 1.0 (maximum braking).
629bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
630e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_BRAKE = 23,
631bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
632bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Distance axis of a motion event.
633bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
634bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a stylus, reports the distance of the stylus from the screen.
635bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * A value of 0.0 indicates direct contact and larger values indicate increasing
636bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * distance from the surface.
637bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
638e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_DISTANCE = 24,
639bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
640bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Tilt axis of a motion event.
641bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     *
642bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * - For a stylus, reports the tilt angle of the stylus in radians where
643bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * 0 radians indicates that the stylus is being held perpendicular to the
644bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * surface, and PI/2 radians indicates that the stylus is being held flat
645bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * against the surface.
646bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
647e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_TILT = 25,
648bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
6491941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani     * Axis constant:  Generic scroll axis of a motion event.
6501941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani     *
6511941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani     * - This is used for scroll axis motion events that can't be classified as strictly
6521941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani     *   vertical or horizontal. The movement of a rotating scroller is an example of this.
6531941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani     */
6541941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani    AMOTION_EVENT_AXIS_SCROLL = 26,
6551941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani    /**
656fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * Axis constant: The movement of x position of a motion event.
657fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     *
658fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * - For a mouse, reports a difference of x position between the previous position.
659fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * This is useful when pointer is captured, in that case the mouse pointer doesn't
660fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * change the location but this axis reports the difference which allows the app
661fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * to see how the mouse is moved.
662fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     */
663fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai    AMOTION_EVENT_AXIS_RELATIVE_X = 27,
664fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai    /**
665fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * Axis constant: The movement of y position of a motion event.
666fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     *
667fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     * Same as {@link RELATIVE_X}, but for y position.
668fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai     */
669fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai    AMOTION_EVENT_AXIS_RELATIVE_Y = 28,
670fa1706afaf12b48fe0ab6d4b061b614bf901b173Jun Mukai    /**
671bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 1 axis of a motion event.
672bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
673bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
674e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_1 = 32,
675bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
676bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 2 axis of a motion event.
677bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
678bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
679e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_2 = 33,
680bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
681bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 3 axis of a motion event.
682bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
683bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
684e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_3 = 34,
685bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
686bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 4 axis of a motion event.
687bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
688bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
689e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_4 = 35,
690bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
691bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 5 axis of a motion event.
692bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
693bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
694e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_5 = 36,
695bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
696bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 6 axis of a motion event.
697bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
698bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
699e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_6 = 37,
700bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
701bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 7 axis of a motion event.
702bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
703bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
704e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_7 = 38,
705bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
706bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 8 axis of a motion event.
707bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
708bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
709e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_8 = 39,
710bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
711bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 9 axis of a motion event.
712bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
713bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
714e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_9 = 40,
715bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
716bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 10 axis of a motion event.
717bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
718bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
719e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_10 = 41,
720bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
721bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 11 axis of a motion event.
722bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
723bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
724e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_11 = 42,
725bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
726bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 12 axis of a motion event.
727bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
728bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
729e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_12 = 43,
730bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
731bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 13 axis of a motion event.
732bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
733bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
734e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_13 = 44,
735bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
736bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 14 axis of a motion event.
737bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
738bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
739e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_14 = 45,
740bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
741bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 15 axis of a motion event.
742bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
743bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
744e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_15 = 46,
745bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /**
746bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * Axis constant: Generic 16 axis of a motion event.
747bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     * The interpretation of a generic axis is device-specific.
748bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine     */
749e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_AXIS_GENERIC_16 = 47,
750e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
751e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    // NOTE: If you add a new axis here you must also add it to several other files.
752e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    //       Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.
753e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
754e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
755bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
756e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Constants that identify buttons that are associated with motion events.
757e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Refer to the documentation on the MotionEvent class for descriptions of each button.
758e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
759e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
760bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** primary */
761e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0,
762bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** secondary */
763e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1,
764bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** tertiary */
765e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2,
766bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** back */
767e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_BUTTON_BACK = 1 << 3,
768bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** forward */
769e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_BUTTON_FORWARD = 1 << 4,
7707b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    AMOTION_EVENT_BUTTON_STYLUS_PRIMARY = 1 << 5,
7717b159c9a4f589da7fdab7c16f3aefea25e0e7e4fMichael Wright    AMOTION_EVENT_BUTTON_STYLUS_SECONDARY = 1 << 6,
772e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
773e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
774bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
775e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Constants that identify tool types.
776e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Refer to the documentation on the MotionEvent class for descriptions of each tool type.
777e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
778e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
779bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** unknown */
780e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0,
781bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** finger */
782e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_TOOL_TYPE_FINGER = 1,
783bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** stylus */
784e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_TOOL_TYPE_STYLUS = 2,
785bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** mouse */
786e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_TOOL_TYPE_MOUSE = 3,
787bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** eraser */
788e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AMOTION_EVENT_TOOL_TYPE_ERASER = 4,
789e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
790e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
791bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
792bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Input source masks.
793e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
794e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Refer to the documentation on android.view.InputDevice for more details about input sources
795e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and their correct interpretation.
796e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
797e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
798bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** mask */
799e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_MASK = 0x000000ff,
800e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
801bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** none */
802aadaca7169b847d855cf43d94f74800e9faadfc8Michael Wright    AINPUT_SOURCE_CLASS_NONE = 0x00000000,
803bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** button */
804e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_BUTTON = 0x00000001,
805bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** pointer */
806e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_POINTER = 0x00000002,
807bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** navigation */
808e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004,
809bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** position */
810e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_POSITION = 0x00000008,
811bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** joystick */
812e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010,
813e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
814e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
815bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
816bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Input sources.
817bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
818e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
819bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** unknown */
820e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_UNKNOWN = 0x00000000,
821e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
822bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** keyboard */
823e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON,
824bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** dpad */
825e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON,
826bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** gamepad */
827e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON,
828bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** touchscreen */
829e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER,
830bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** mouse */
831e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER,
832bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** stylus */
833e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER,
8347d3ad695304a1f24026227e630add6edd76fd0d6Michael Wright    /** bluetooth stylus */
8352f78b68cf15c3d96eccbb242316d174ed739dc69Michael Wright    AINPUT_SOURCE_BLUETOOTH_STYLUS = 0x00008000 | AINPUT_SOURCE_STYLUS,
836bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** trackball */
837e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
83878f97b3263053c388080a738b56499139517c3b6Vladislav Kaznacheev    /** mouse relative */
83978f97b3263053c388080a738b56499139517c3b6Vladislav Kaznacheev    AINPUT_SOURCE_MOUSE_RELATIVE = 0x00020000 | AINPUT_SOURCE_CLASS_NAVIGATION,
840bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** touchpad */
841e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
842bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** navigation */
843aadaca7169b847d855cf43d94f74800e9faadfc8Michael Wright    AINPUT_SOURCE_TOUCH_NAVIGATION = 0x00200000 | AINPUT_SOURCE_CLASS_NONE,
844bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** joystick */
845e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK,
8461941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani    /** rotary encoder */
8471941ff5815e9f8a09f6ae643addbb4119482cf16Prashant Malani    AINPUT_SOURCE_ROTARY_ENCODER = 0x00400000 | AINPUT_SOURCE_CLASS_NONE,
848e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
849bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** any */
850e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_SOURCE_ANY = 0xffffff00,
851e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
852e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
853bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
854e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Keyboard types.
855e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
856e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Refer to the documentation on android.view.InputDevice for more details.
857e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
858e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
859bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** none */
860e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_KEYBOARD_TYPE_NONE = 0,
861bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** non alphabetic */
862e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
863bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** alphabetic */
864e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2,
865e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian};
866e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
867bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
868e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Constants used to retrieve information about the range of motion for a particular
869e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * coordinate of a motion event.
870e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
871e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Refer to the documentation on android.view.InputDevice for more details about input sources
872e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and their correct interpretation.
873e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
874bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * @deprecated These constants are deprecated. Use {@link AMOTION_EVENT_AXIS AMOTION_EVENT_AXIS_*} constants instead.
875e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
876e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianenum {
877bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** x */
878e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_X = AMOTION_EVENT_AXIS_X,
879bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** y */
880e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_Y = AMOTION_EVENT_AXIS_Y,
881bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** pressure */
882e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_PRESSURE = AMOTION_EVENT_AXIS_PRESSURE,
883bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** size */
884e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_SIZE = AMOTION_EVENT_AXIS_SIZE,
885bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** touch major */
886e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_TOUCH_MAJOR = AMOTION_EVENT_AXIS_TOUCH_MAJOR,
887bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** touch minor */
888e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_TOUCH_MINOR = AMOTION_EVENT_AXIS_TOUCH_MINOR,
889bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** tool major */
890e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_TOOL_MAJOR = AMOTION_EVENT_AXIS_TOOL_MAJOR,
891bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** tool minor */
892e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_TOOL_MINOR = AMOTION_EVENT_AXIS_TOOL_MINOR,
893bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine    /** orientation */
894e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian    AINPUT_MOTION_RANGE_ORIENTATION = AMOTION_EVENT_AXIS_ORIENTATION,
895bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine};
896e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
897e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
898bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
899e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input event accessors.
900e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
901e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Note that most functions can only be used on input events that are of a given type.
902e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Calling these functions on input events of other types will yield undefined behavior.
903e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
904e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
905e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/*** Accessors for all input events. ***/
906e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
907bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the input event type. */
908e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputEvent_getType(const AInputEvent* event);
909e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
910bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the id for the device that an input event came from.
911e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
912e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input events can be generated by multiple different input devices.
913e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Use the input device id to obtain information about the input
914e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * device that was responsible for generating a particular event.
915e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
916e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * An input device id of 0 indicates that the event didn't come from a physical device;
917e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * other numbers are arbitrary and you shouldn't depend on the values.
918e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Use the provided input device query API to obtain information about input devices.
919e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
920e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputEvent_getDeviceId(const AInputEvent* event);
921e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
922bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the input event source. */
923e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputEvent_getSource(const AInputEvent* event);
924e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
925e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/*** Accessors for key events only. ***/
926e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
927bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the key event action. */
928e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getAction(const AInputEvent* key_event);
929e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
930bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the key event flags. */
931e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getFlags(const AInputEvent* key_event);
932e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
933bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
934bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the key code of the key event.
935bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * This is the physical key that was pressed, not the Unicode character.
936bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
937e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getKeyCode(const AInputEvent* key_event);
938e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
939bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
940bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the hardware key id of this key event.
941bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * These values are not reliable and vary from device to device.
942bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
943e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getScanCode(const AInputEvent* key_event);
944e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
945bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the meta key state. */
946e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getMetaState(const AInputEvent* key_event);
947e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
948bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
949bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the repeat count of the event.
950e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For both key up an key down events, this is the number of times the key has
951e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * repeated with the first down starting at 0 and counting up from there.  For
952bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * multiple key events, this is the number of down/up pairs that have occurred.
953bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
954e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event);
955e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
956bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
957bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the time of the most recent key down event, in the
958e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * java.lang.System.nanoTime() time base.  If this is a down event,
959e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * this will be the same as eventTime.
960e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Note that when chording keys, this value is the down time of the most recently
961bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * pressed key, which may not be the same physical key of this event.
962bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
963e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint64_t AKeyEvent_getDownTime(const AInputEvent* key_event);
964e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
965bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
966bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the time this event occurred, in the
967bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * java.lang.System.nanoTime() time base.
968bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
969e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint64_t AKeyEvent_getEventTime(const AInputEvent* key_event);
970e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
971e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian/*** Accessors for motion events only. ***/
972e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
973bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the combined motion event action code and pointer index. */
974e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getAction(const AInputEvent* motion_event);
975e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
976bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the motion event flags. */
977e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getFlags(const AInputEvent* motion_event);
978e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
979bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
980bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the state of any meta / modifier keys that were in effect when the
981bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * event was generated.
982bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
983e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);
984e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
985494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#if __ANDROID_API__ >= 14
986bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the button state of all buttons that are pressed. */
987e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
988494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#endif
989e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
990bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
991bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get a bitfield indicating which edges, if any, were touched by this motion event.
992e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events, clients can use this to determine if the user's finger was
993bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * touching the edge of the display.
994bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
995e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event);
996e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
997bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
998bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the time when the user originally pressed down to start a stream of
999bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * position events, in the java.lang.System.nanoTime() time base.
1000bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1001e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint64_t AMotionEvent_getDownTime(const AInputEvent* motion_event);
1002e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1003bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1004bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the time when this specific event was generated,
1005bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * in the java.lang.System.nanoTime() time base.
1006bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1007e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint64_t AMotionEvent_getEventTime(const AInputEvent* motion_event);
1008e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1009bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1010bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the X coordinate offset.
1011e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the delta that was added to the raw
1012e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * screen coordinates to adjust for the absolute position of the containing windows
1013bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * and views.
1014bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1015e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getXOffset(const AInputEvent* motion_event);
1016e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1017bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1018bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the Y coordinate offset.
1019e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the delta that was added to the raw
1020e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * screen coordinates to adjust for the absolute position of the containing windows
1021bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * and views.
1022bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1023e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getYOffset(const AInputEvent* motion_event);
1024e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1025bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1026bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the precision of the X coordinates being reported.
1027e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * You can multiply this number with an X coordinate sample to find the
1028bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * actual hardware value of the X coordinate.
1029bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1030e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getXPrecision(const AInputEvent* motion_event);
1031e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1032bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1033bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the precision of the Y coordinates being reported.
1034e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * You can multiply this number with a Y coordinate sample to find the
1035bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * actual hardware value of the Y coordinate.
1036bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1037e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getYPrecision(const AInputEvent* motion_event);
1038e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1039bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1040bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the number of pointers of data contained in this event.
1041bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Always >= 1.
1042bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1043e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopiansize_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
1044e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1045bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1046bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the pointer identifier associated with a particular pointer
1047e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * data index in this event.  The identifier tells you the actual pointer
1048e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * number associated with the data, accounting for individual pointers
1049bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * going up and down since the start of the current gesture.
1050bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1051e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);
1052e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1053494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#if __ANDROID_API__ >= 14
1054bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1055bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the tool type of a pointer for the given pointer index.
1056e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The tool type indicates the type of tool used to make contact such as a
1057bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * finger or stylus, if known.
1058bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1059e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
1060494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#endif
1061e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1062bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1063bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the original raw X coordinate of this event.
1064e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the original location of the event
1065e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * on the screen, before it had been adjusted for the containing window
1066bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * and views.
1067bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1068e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index);
1069e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1070bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1071bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the original raw X coordinate of this event.
1072e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the original location of the event
1073e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * on the screen, before it had been adjusted for the containing window
1074bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * and views.
1075bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1076e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index);
1077e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1078bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1079bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current X coordinate of this event for the given pointer index.
1080e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1081bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1082bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1083e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index);
1084e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1085bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1086bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current Y coordinate of this event for the given pointer index.
1087e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1088bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1089bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1090e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index);
1091e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1092bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1093bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current pressure of this event for the given pointer index.
1094e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
1095e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * although values higher than 1 may be generated depending on the calibration of
1096bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * the input device.
1097bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1098e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index);
1099e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1100bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1101bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current scaled value of the approximate size for the given pointer index.
1102e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * This represents some approximation of the area of the screen being
1103e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * pressed; the actual value in pixels corresponding to the
1104e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * touch is normalized with the device specific range of values
1105e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and scaled to a value between 0 and 1.  The value of size can be used to
1106bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * determine fat touch events.
1107bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1108e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index);
1109e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1110bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1111bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current length of the major axis of an ellipse that describes the touch area
1112bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * at the point of contact for the given pointer index.
1113bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1114e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index);
1115e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1116bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1117bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current length of the minor axis of an ellipse that describes the touch area
1118bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * at the point of contact for the given pointer index.
1119bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1120e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index);
1121e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1122bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1123bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current length of the major axis of an ellipse that describes the size
1124e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * of the approaching tool for the given pointer index.
1125e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The tool area represents the estimated size of the finger or pen that is
1126bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * touching the device independent of its actual touch area at the point of contact.
1127bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1128e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index);
1129e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1130bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1131bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current length of the minor axis of an ellipse that describes the size
1132e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * of the approaching tool for the given pointer index.
1133e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The tool area represents the estimated size of the finger or pen that is
1134bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * touching the device independent of its actual touch area at the point of contact.
1135bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1136e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index);
1137e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1138bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1139bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current orientation of the touch area and tool area in radians clockwise from
1140e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * vertical for the given pointer index.
1141e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * An angle of 0 degrees indicates that the major axis of contact is oriented
1142e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * upwards, is perfectly circular or is of unknown orientation.  A positive angle
1143e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * indicates that the major axis of contact is oriented to the right.  A negative angle
1144e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * indicates that the major axis of contact is oriented to the left.
1145e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
1146bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * (finger pointing fully right).
1147bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1148e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index);
1149e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1150494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#if __ANDROID_API__ >= 13
1151bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** Get the value of the request axis for the given pointer index. */
1152e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getAxisValue(const AInputEvent* motion_event,
1153e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        int32_t axis, size_t pointer_index);
1154494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#endif
1155e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1156bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1157bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the number of historical points in this event.  These are movements that
1158e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * have occurred between this event and the previous event.  This only applies
1159e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * to AMOTION_EVENT_ACTION_MOVE events -- all other actions will have a size of 0.
1160bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Historical samples are indexed from oldest to newest.
1161bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1162e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopiansize_t AMotionEvent_getHistorySize(const AInputEvent* motion_event);
1163e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1164bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1165bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the time that a historical movement occurred between this event and
1166bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * the previous event, in the java.lang.System.nanoTime() time base.
1167bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
116826c24162817a1986c2afbff15dbe896b0cbcc01dAndrew Hsiehint64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event,
1169e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1170e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1171bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1172bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical raw X coordinate of this event for the given pointer index that
1173e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1174e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the original location of the event
1175e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * on the screen, before it had been adjusted for the containing window
1176e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and views.
1177e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1178bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1179bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1180e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index,
1181e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1182e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1183bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1184bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical raw Y coordinate of this event for the given pointer index that
1185e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1186e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * For touch events on the screen, this is the original location of the event
1187e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * on the screen, before it had been adjusted for the containing window
1188e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and views.
1189e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1190bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1191bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1192e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index,
1193e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1194e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1195bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1196bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical X coordinate of this event for the given pointer index that
1197e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1198e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1199bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1200bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
120126c24162817a1986c2afbff15dbe896b0cbcc01dAndrew Hsiehfloat AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index,
1202e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1203e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1204bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1205bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical Y coordinate of this event for the given pointer index that
1206e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1207e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Whole numbers are pixels; the value may have a fraction for input devices
1208bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that are sub-pixel precise.
1209bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
121026c24162817a1986c2afbff15dbe896b0cbcc01dAndrew Hsiehfloat AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index,
1211e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1212e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1213bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1214bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical pressure of this event for the given pointer index that
1215e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1216e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
1217e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * although values higher than 1 may be generated depending on the calibration of
1218bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * the input device.
1219bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
122026c24162817a1986c2afbff15dbe896b0cbcc01dAndrew Hsiehfloat AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index,
1221e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1222e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1223bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1224bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the current scaled value of the approximate size for the given pointer index that
1225e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1226e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * This represents some approximation of the area of the screen being
1227e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * pressed; the actual value in pixels corresponding to the
1228e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * touch is normalized with the device specific range of values
1229e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * and scaled to a value between 0 and 1.  The value of size can be used to
1230bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * determine fat touch events.
1231bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
123226c24162817a1986c2afbff15dbe896b0cbcc01dAndrew Hsiehfloat AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index,
1233e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1234e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1235bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1236bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical length of the major axis of an ellipse that describes the touch area
1237e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * at the point of contact for the given pointer index that
1238bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * occurred between this event and the previous motion event.
1239bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1240e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index,
1241e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1242e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1243bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1244bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical length of the minor axis of an ellipse that describes the touch area
1245e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * at the point of contact for the given pointer index that
1246bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * occurred between this event and the previous motion event.
1247bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1248e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index,
1249e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1250e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1251bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1252bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical length of the major axis of an ellipse that describes the size
1253e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * of the approaching tool for the given pointer index that
1254e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1255e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The tool area represents the estimated size of the finger or pen that is
1256bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * touching the device independent of its actual touch area at the point of contact.
1257bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1258e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index,
1259e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1260e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1261bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1262bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical length of the minor axis of an ellipse that describes the size
1263e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * of the approaching tool for the given pointer index that
1264e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1265e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The tool area represents the estimated size of the finger or pen that is
1266bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * touching the device independent of its actual touch area at the point of contact.
1267bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1268e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index,
1269e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1270e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1271bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1272bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical orientation of the touch area and tool area in radians clockwise from
1273e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * vertical for the given pointer index that
1274e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * occurred between this event and the previous motion event.
1275e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * An angle of 0 degrees indicates that the major axis of contact is oriented
1276e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * upwards, is perfectly circular or is of unknown orientation.  A positive angle
1277e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * indicates that the major axis of contact is oriented to the right.  A negative angle
1278e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * indicates that the major axis of contact is oriented to the left.
1279e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
1280bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * (finger pointing fully right).
1281bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1282e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
1283e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        size_t history_index);
1284e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1285494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#if __ANDROID_API__ >= 13
1286bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1287bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * Get the historical value of the request axis for the given pointer index
1288bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine * that occurred between this event and the previous motion event.
1289bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine */
1290e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianfloat AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
1291e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        int32_t axis, size_t pointer_index, size_t history_index);
1292494ed550f5aea1332984fb9f0f11036fc58bd716Dan Albert#endif
1293e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1294e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1295bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosinestruct AInputQueue;
1296bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1297e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Input queue
1298e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian *
1299e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * An input queue is the facility through which you retrieve input
1300e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * events.
1301e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1302e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopiantypedef struct AInputQueue AInputQueue;
1303e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1304bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1305e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Add this input queue to a looper for processing.  See
1306e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * ALooper_addFd() for information on the ident, callback, and data params.
1307e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1308e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianvoid AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper,
1309e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian        int ident, ALooper_callbackFunc callback, void* data);
1310e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1311bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1312e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Remove the input queue from the looper it is currently attached to.
1313e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1314e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianvoid AInputQueue_detachLooper(AInputQueue* queue);
1315e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1316bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1317e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Returns true if there are one or more events available in the
1318e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * input queue.  Returns 1 if the queue has events; 0 if
1319e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * it does not have events; and a negative value if there is an error.
1320e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1321e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputQueue_hasEvents(AInputQueue* queue);
1322e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1323bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1324e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Returns the next available event from the queue.  Returns a negative
1325e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * value if no events are available or an error has occurred.
1326e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1327e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
1328e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1329bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1330e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Sends the key for standard pre-dispatching -- that is, possibly deliver
1331e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * it to the current IME to be consumed before the app.  Returns 0 if it
1332e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * was not pre-dispatched, meaning you can process it right now.  If non-zero
1333e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * is returned, you must abandon the current event processing and allow the
1334e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * event to appear again in the event queue (if it does not get consumed during
1335e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * pre-dispatching).
1336e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1337e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianint32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
1338e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1339bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/**
1340e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * Report that dispatching has finished with the given event.
1341e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian * This must be called after receiving an event with AInputQueue_get_event().
1342e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian */
1343e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopianvoid AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled);
1344e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1345e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#ifdef __cplusplus
1346e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian}
1347e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#endif
1348e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian
1349e1c61d3cc8458ce9a15d8109f728e60f5248939dMathias Agopian#endif // _ANDROID_INPUT_H
1350bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine
1351bf6d5e012cd9b15568c2351831f3349cf564bf18Johan Euphrosine/** @} */
1352