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