111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Copyright (C) 2010 The Android Open Source Project
311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Licensed under the Apache License, Version 2.0 (the "License");
511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * you may not use this file except in compliance with the License.
611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * You may obtain a copy of the License at
711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *      http://www.apache.org/licenses/LICENSE-2.0
911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
1011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Unless required by applicable law or agreed to in writing, software
1111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * distributed under the License is distributed on an "AS IS" BASIS,
1211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * See the License for the specific language governing permissions and
1411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * limitations under the License.
1511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
1611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
1711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifndef _ANDROID_INPUT_H
1811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define _ANDROID_INPUT_H
1911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
2011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/******************************************************************
2111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
2211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * IMPORTANT NOTICE:
2311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
2411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   This file is part of Android's set of stable system headers
2511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   exposed by the Android NDK (Native Development Kit).
2611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
2711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   Third-party source AND binary code relies on the definitions
2811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
2911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
3011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
3111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
3211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
3311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
3411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
3511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
3611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
3711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Structures and functions to receive and process input events in
3811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * native code.
3911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
4011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * NOTE: These functions MUST be implemented by /system/lib/libui.so
4111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
4211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
4311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <stdint.h>
4411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <sys/types.h>
4511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <android/keycodes.h>
4611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#include <android/looper.h>
4711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
4811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifdef __cplusplus
4911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertextern "C" {
5011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif
5111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
5211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
5311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Key states (may be returned by queries about the current state of a
5411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * particular key code, scan code or switch).
5511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
5611cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
5711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key state is unknown or the requested key itself is not supported. */
5811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_STATE_UNKNOWN = -1,
5911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
6011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key is up. */
6111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_STATE_UP = 0,
6211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
6311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key is down. */
6411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_STATE_DOWN = 1,
6511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
6611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key is down but is a virtual key press that is being emulated by the system. */
6711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_STATE_VIRTUAL = 2
6811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
6911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
7011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
7111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Meta key / modifer state.
7211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
7311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
7411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* No meta keys are pressed. */
7511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_NONE = 0,
7611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
7711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether one of the ALT meta keys is pressed. */
7811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_ALT_ON = 0x02,
7911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
8011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the left ALT meta key is pressed. */
8111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_ALT_LEFT_ON = 0x10,
8211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
8311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the right ALT meta key is pressed. */
8411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_ALT_RIGHT_ON = 0x20,
8511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
8611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether one of the SHIFT meta keys is pressed. */
8711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_SHIFT_ON = 0x01,
8811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
8911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the left SHIFT meta key is pressed. */
9011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_SHIFT_LEFT_ON = 0x40,
9111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
9211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the right SHIFT meta key is pressed. */
9311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_SHIFT_RIGHT_ON = 0x80,
9411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
9511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the SYM meta key is pressed. */
9611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_SYM_ON = 0x04,
9711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
9811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the FUNCTION meta key is pressed. */
9911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_FUNCTION_ON = 0x08,
10011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
10111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether one of the CTRL meta keys is pressed. */
10211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_CTRL_ON = 0x1000,
10311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
10411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the left CTRL meta key is pressed. */
10511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_CTRL_LEFT_ON = 0x2000,
10611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
10711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the right CTRL meta key is pressed. */
10811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_CTRL_RIGHT_ON = 0x4000,
10911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
11011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether one of the META meta keys is pressed. */
11111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_META_ON = 0x10000,
11211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
11311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the left META meta key is pressed. */
11411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_META_LEFT_ON = 0x20000,
11511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
11611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the right META meta key is pressed. */
11711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_META_RIGHT_ON = 0x40000,
11811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
11911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the CAPS LOCK meta key is on. */
12011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_CAPS_LOCK_ON = 0x100000,
12111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
12211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the NUM LOCK meta key is on. */
12311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_NUM_LOCK_ON = 0x200000,
12411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
12511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used to check whether the SCROLL LOCK meta key is on. */
12611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMETA_SCROLL_LOCK_ON = 0x400000,
12711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
12811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
12911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
13011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input events.
13111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
13211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input events are opaque structures.  Use the provided accessors functions to
13311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * read their properties.
13411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
13511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct AInputEvent;
13611cd02dfb91661c65134cac258cf5924270e9d2Dan Alberttypedef struct AInputEvent AInputEvent;
13711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
13811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
13911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input event types.
14011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
14111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
14211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Indicates that the input event is a key event. */
14311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_EVENT_TYPE_KEY = 1,
14411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
14511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Indicates that the input event is a motion event. */
14611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_EVENT_TYPE_MOTION = 2
14711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
14811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
14911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
15011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Key event actions.
15111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
15211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
15311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key has been pressed down. */
15411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_ACTION_DOWN = 0,
15511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
15611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The key has been released. */
15711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_ACTION_UP = 1,
15811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
15911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Multiple duplicate key events have occurred in a row, or a complex string is
16011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * being delivered.  The repeat_count property of the key event contains the number
16111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * of times the given key code should be executed.
16211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
16311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_ACTION_MULTIPLE = 2
16411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
16511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
16611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
16711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Key event flags.
16811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
16911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
17011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is set if the device woke because of this key event. */
17111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_WOKE_HERE = 0x1,
17211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
17311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is set if the key event was generated by a software keyboard. */
17411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2,
17511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
17611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is set if we don't want the key event to cause us to leave touch mode. */
17711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4,
17811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
17911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is set if an event was known to come from a trusted part
18011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * of the system.  That is, the event is known to come from the user,
18111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * and could not have been spoofed by a third party component. */
18211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8,
18311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
18411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This mask is used for compatibility, to identify enter keys that are
18511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * coming from an IME whose enter key has been auto-labelled "next" or
18611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * "done".  This allows TextView to dispatch these as normal enter keys
18711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * for old applications, but still do the appropriate action when
18811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * receiving them. */
18911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10,
19011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
19111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* When associated with up key events, this indicates that the key press
19211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * has been canceled.  Typically this is used with virtual touch screen
19311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * keys, where the user can slide from the virtual key area on to the
19411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * display: in that case, the application will receive a canceled up
19511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * event and should not perform the action normally associated with the
19611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * key.  Note that for this to work, the application can not perform an
19711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * action for a key until it receives an up or the long press timeout has
19811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * expired. */
19911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_CANCELED = 0x20,
20011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
20111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This key event was generated by a virtual (on-screen) hard key area.
20211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * Typically this is an area of the touchscreen, outside of the regular
20311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * display, dedicated to "hardware" buttons. */
20411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40,
20511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
20611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This flag is set for the first key repeat that occurs after the
20711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * long press timeout. */
20811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_LONG_PRESS = 0x80,
20911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
21011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
21111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * press action was executed while it was down. */
21211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100,
21311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
21411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
21511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * tracked from its initial down.  That is, somebody requested that tracking
21611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * started on the key down and a long press has not caused
21711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * the tracking to be canceled. */
21811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_TRACKING = 0x200,
21911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
22011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Set when a key event has been synthesized to implement default behavior
22111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * for an event that the application did not handle.
22211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * Fallback key events are generated by unhandled trackball motions
22311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * (to emulate a directional keypad) and by certain unhandled key presses
22411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * that are declared in the key map (such as special function numeric keypad
22511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * keys when numlock is off). */
22611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AKEY_EVENT_FLAG_FALLBACK = 0x400,
22711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
22811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
22911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
23011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Motion event actions.
23111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
23211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
23311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Bit shift for the action bits holding the pointer index as
23411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
23511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
23611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
23711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
23811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
23911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Bit mask of the parts of the action code that are the action itself.
24011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
24111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_MASK = 0xff,
24211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
24311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Bits in the action code that represent a pointer index, used with
24411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP.  Shifting
24511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
24611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * index where the data for the pointer going up or down can be found.
24711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
24811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_POINTER_INDEX_MASK  = 0xff00,
24911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
25011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A pressed gesture has started, the motion contains the initial starting location.
25111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
25211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_DOWN = 0,
25311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
25411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A pressed gesture has finished, the motion contains the final release location
25511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * as well as any intermediate points since the last down or move event.
25611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
25711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_UP = 1,
25811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
25911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
26011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * AMOTION_EVENT_ACTION_UP).  The motion contains the most recent point, as well as
26111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * any intermediate points since the last down or move event.
26211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
26311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_MOVE = 2,
26411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
26511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The current gesture has been aborted.
26611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * You will not receive any more points in it.  You should treat this as
26711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * an up event, but not perform any action that you normally would.
26811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
26911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_CANCEL = 3,
27011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
27111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A movement has happened outside of the normal bounds of the UI element.
27211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * This does not provide a full gesture, but only the initial location of the movement/touch.
27311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
27411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_OUTSIDE = 4,
27511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
27611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A non-primary pointer has gone down.
27711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
27811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
27911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
28011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
28111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A non-primary pointer has gone up.
28211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
28311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
28411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_POINTER_UP = 6,
28511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
28611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE).
28711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * The motion contains the most recent point, as well as any intermediate points since
28811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * the last hover move event.
28911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
29011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_HOVER_MOVE = 7,
29111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
29211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The motion event contains relative vertical and/or horizontal scroll offsets.
29311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL
29411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * and AMOTION_EVENT_AXIS_HSCROLL.
29511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * The pointer may or may not be down when this event is dispatched.
29611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * This action is always delivered to the winder under the pointer, which
29711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * may not be the window currently touched.
29811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
29911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_SCROLL = 8,
30011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
30111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The pointer is not down but has entered the boundaries of a window or view.
30211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
30311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_HOVER_ENTER = 9,
30411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
30511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* The pointer is not down but has exited the boundaries of a window or view.
30611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
30711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_ACTION_HOVER_EXIT = 10,
30811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
30911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
31011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
31111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Motion event flags.
31211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
31311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
31411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* This flag indicates that the window that received this motion event is partly
31511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * or wholly obscured by another visible window above it.  This flag is set to true
31611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * even if the event did not directly pass through the obscured area.
31711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * A security sensitive application can check this flag to identify situations in which
31811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * a malicious application may have covered up part of its content for the purpose
31911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * of misleading the user or hijacking touches.  An appropriate response might be
32011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * to drop the suspect touches or to take additional precautions to confirm the user's
32111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     * actual intent.
32211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert     */
32311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1,
32411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
32511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
32611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
32711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Motion event edge touch flags.
32811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
32911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
33011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* No edges intersected */
33111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_EDGE_FLAG_NONE = 0,
33211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
33311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Flag indicating the motion event intersected the top edge of the screen. */
33411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_EDGE_FLAG_TOP = 0x01,
33511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
33611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Flag indicating the motion event intersected the bottom edge of the screen. */
33711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02,
33811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
33911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Flag indicating the motion event intersected the left edge of the screen. */
34011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04,
34111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
34211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    /* Flag indicating the motion event intersected the right edge of the screen. */
34311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08
34411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
34511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
34611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
34711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Constants that identify each individual axis of a motion event.
34811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on the MotionEvent class for descriptions of each axis.
34911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
35011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
35111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_X = 0,
35211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_Y = 1,
35311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_PRESSURE = 2,
35411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_SIZE = 3,
35511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4,
35611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_TOUCH_MINOR = 5,
35711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_TOOL_MAJOR = 6,
35811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_TOOL_MINOR = 7,
35911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_ORIENTATION = 8,
36011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_VSCROLL = 9,
36111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_HSCROLL = 10,
36211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_Z = 11,
36311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_RX = 12,
36411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_RY = 13,
36511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_RZ = 14,
36611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_HAT_X = 15,
36711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_HAT_Y = 16,
36811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_LTRIGGER = 17,
36911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_RTRIGGER = 18,
37011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_THROTTLE = 19,
37111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_RUDDER = 20,
37211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_WHEEL = 21,
37311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GAS = 22,
37411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_BRAKE = 23,
37511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_DISTANCE = 24,
37611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_TILT = 25,
37711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_1 = 32,
37811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_2 = 33,
37911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_3 = 34,
38011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_4 = 35,
38111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_5 = 36,
38211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_6 = 37,
38311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_7 = 38,
38411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_8 = 39,
38511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_9 = 40,
38611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_10 = 41,
38711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_11 = 42,
38811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_12 = 43,
38911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_13 = 44,
39011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_14 = 45,
39111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_15 = 46,
39211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_AXIS_GENERIC_16 = 47,
39311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
39411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    // NOTE: If you add a new axis here you must also add it to several other files.
39511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    //       Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list.
39611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
39711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
39811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
39911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Constants that identify buttons that are associated with motion events.
40011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on the MotionEvent class for descriptions of each button.
40111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
40211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
40311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0,
40411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1,
40511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2,
40611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_BUTTON_BACK = 1 << 3,
40711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_BUTTON_FORWARD = 1 << 4,
40811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
40911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
41011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
41111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Constants that identify tool types.
41211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on the MotionEvent class for descriptions of each tool type.
41311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
41411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
41511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0,
41611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_TOOL_TYPE_FINGER = 1,
41711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_TOOL_TYPE_STYLUS = 2,
41811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_TOOL_TYPE_MOUSE = 3,
41911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AMOTION_EVENT_TOOL_TYPE_ERASER = 4,
42011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
42111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
42211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
42311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input sources.
42411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
42511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on android.view.InputDevice for more details about input sources
42611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and their correct interpretation.
42711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
42811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
42911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_MASK = 0x000000ff,
43011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
43111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_NONE = 0x00000000,
43211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_BUTTON = 0x00000001,
43311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_POINTER = 0x00000002,
43411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004,
43511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_POSITION = 0x00000008,
43611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010,
43711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
43811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
43911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
44011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_UNKNOWN = 0x00000000,
44111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
44211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON,
44311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON,
44411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON,
44511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER,
44611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER,
44711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER,
44811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
44911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
45011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_TOUCH_NAVIGATION = 0x00200000 | AINPUT_SOURCE_CLASS_NONE,
45111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK,
45211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
45311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_SOURCE_ANY = 0xffffff00,
45411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
45511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
45611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
45711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Keyboard types.
45811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
45911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on android.view.InputDevice for more details.
46011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
46111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
46211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_KEYBOARD_TYPE_NONE = 0,
46311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
46411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2,
46511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert};
46611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
46711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
46811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Constants used to retrieve information about the range of motion for a particular
46911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * coordinate of a motion event.
47011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
47111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Refer to the documentation on android.view.InputDevice for more details about input sources
47211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and their correct interpretation.
47311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
47411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * DEPRECATION NOTICE: These constants are deprecated.  Use AMOTION_EVENT_AXIS_* constants instead.
47511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
47611cd02dfb91661c65134cac258cf5924270e9d2Dan Albertenum {
47711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_X = AMOTION_EVENT_AXIS_X,
47811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_Y = AMOTION_EVENT_AXIS_Y,
47911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_PRESSURE = AMOTION_EVENT_AXIS_PRESSURE,
48011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_SIZE = AMOTION_EVENT_AXIS_SIZE,
48111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_TOUCH_MAJOR = AMOTION_EVENT_AXIS_TOUCH_MAJOR,
48211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_TOUCH_MINOR = AMOTION_EVENT_AXIS_TOUCH_MINOR,
48311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_TOOL_MAJOR = AMOTION_EVENT_AXIS_TOOL_MAJOR,
48411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_TOOL_MINOR = AMOTION_EVENT_AXIS_TOOL_MINOR,
48511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert    AINPUT_MOTION_RANGE_ORIENTATION = AMOTION_EVENT_AXIS_ORIENTATION,
48611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert} __attribute__ ((deprecated));
48711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
48811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
48911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
49011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input event accessors.
49111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
49211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Note that most functions can only be used on input events that are of a given type.
49311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Calling these functions on input events of other types will yield undefined behavior.
49411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
49511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
49611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*** Accessors for all input events. ***/
49711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
49811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the input event type. */
49911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputEvent_getType(const AInputEvent* event);
50011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
50111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the id for the device that an input event came from.
50211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
50311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input events can be generated by multiple different input devices.
50411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Use the input device id to obtain information about the input
50511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * device that was responsible for generating a particular event.
50611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
50711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * An input device id of 0 indicates that the event didn't come from a physical device;
50811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * other numbers are arbitrary and you shouldn't depend on the values.
50911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Use the provided input device query API to obtain information about input devices.
51011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
51111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputEvent_getDeviceId(const AInputEvent* event);
51211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
51311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the input event source. */
51411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputEvent_getSource(const AInputEvent* event);
51511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
51611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*** Accessors for key events only. ***/
51711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
51811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the key event action. */
51911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getAction(const AInputEvent* key_event);
52011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
52111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the key event flags. */
52211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getFlags(const AInputEvent* key_event);
52311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
52411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the key code of the key event.
52511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * This is the physical key that was pressed, not the Unicode character. */
52611cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getKeyCode(const AInputEvent* key_event);
52711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
52811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the hardware key id of this key event.
52911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * These values are not reliable and vary from device to device. */
53011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getScanCode(const AInputEvent* key_event);
53111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
53211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the meta key state. */
53311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getMetaState(const AInputEvent* key_event);
53411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
53511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the repeat count of the event.
53611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For both key up an key down events, this is the number of times the key has
53711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * repeated with the first down starting at 0 and counting up from there.  For
53811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * multiple key events, this is the number of down/up pairs that have occurred. */
53911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event);
54011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
54111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the time of the most recent key down event, in the
54211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * java.lang.System.nanoTime() time base.  If this is a down event,
54311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * this will be the same as eventTime.
54411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Note that when chording keys, this value is the down time of the most recently
54511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * pressed key, which may not be the same physical key of this event. */
54611cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint64_t AKeyEvent_getDownTime(const AInputEvent* key_event);
54711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
54811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the time this event occurred, in the
54911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * java.lang.System.nanoTime() time base. */
55011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint64_t AKeyEvent_getEventTime(const AInputEvent* key_event);
55111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
55211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*** Accessors for motion events only. ***/
55311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
55411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the combined motion event action code and pointer index. */
55511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getAction(const AInputEvent* motion_event);
55611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
55711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the motion event flags. */
55811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getFlags(const AInputEvent* motion_event);
55911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
56011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the state of any meta / modifier keys that were in effect when the
56111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * event was generated. */
56211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);
56311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
56411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the button state of all buttons that are pressed. */
56511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getButtonState(const AInputEvent* motion_event);
56611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
56711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get a bitfield indicating which edges, if any, were touched by this motion event.
56811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events, clients can use this to determine if the user's finger was
56911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touching the edge of the display. */
57011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event);
57111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
57211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the time when the user originally pressed down to start a stream of
57311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * position events, in the java.lang.System.nanoTime() time base. */
57411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint64_t AMotionEvent_getDownTime(const AInputEvent* motion_event);
57511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
57611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the time when this specific event was generated,
57711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * in the java.lang.System.nanoTime() time base. */
57811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint64_t AMotionEvent_getEventTime(const AInputEvent* motion_event);
57911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
58011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the X coordinate offset.
58111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the delta that was added to the raw
58211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * screen coordinates to adjust for the absolute position of the containing windows
58311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views. */
58411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getXOffset(const AInputEvent* motion_event) __NDK_FPABI__;
58511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
58611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the Y coordinate offset.
58711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the delta that was added to the raw
58811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * screen coordinates to adjust for the absolute position of the containing windows
58911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views. */
59011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getYOffset(const AInputEvent* motion_event) __NDK_FPABI__;
59111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
59211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the precision of the X coordinates being reported.
59311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * You can multiply this number with an X coordinate sample to find the
59411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * actual hardware value of the X coordinate. */
59511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getXPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
59611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
59711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the precision of the Y coordinates being reported.
59811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * You can multiply this number with a Y coordinate sample to find the
59911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * actual hardware value of the Y coordinate. */
60011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getYPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
60111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
60211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the number of pointers of data contained in this event.
60311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Always >= 1. */
60411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertsize_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
60511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
60611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the pointer identifier associated with a particular pointer
60711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * data index in this event.  The identifier tells you the actual pointer
60811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * number associated with the data, accounting for individual pointers
60911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * going up and down since the start of the current gesture. */
61011cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);
61111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
61211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the tool type of a pointer for the given pointer index.
61311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The tool type indicates the type of tool used to make contact such as a
61411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * finger or stylus, if known. */
61511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index);
61611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
61711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the original raw X coordinate of this event.
61811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the original location of the event
61911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * on the screen, before it had been adjusted for the containing window
62011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views. */
62111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
62211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
62311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the original raw X coordinate of this event.
62411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the original location of the event
62511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * on the screen, before it had been adjusted for the containing window
62611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views. */
62711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
62811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
62911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current X coordinate of this event for the given pointer index.
63011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
63111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
63211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
63311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
63411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current Y coordinate of this event for the given pointer index.
63511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
63611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
63711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
63811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
63911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current pressure of this event for the given pointer index.
64011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
64111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * although values higher than 1 may be generated depending on the calibration of
64211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * the input device. */
64311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
64411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
64511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current scaled value of the approximate size for the given pointer index.
64611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * This represents some approximation of the area of the screen being
64711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * pressed; the actual value in pixels corresponding to the
64811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touch is normalized with the device specific range of values
64911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and scaled to a value between 0 and 1.  The value of size can be used to
65011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * determine fat touch events. */
65111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
65211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
65311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current length of the major axis of an ellipse that describes the touch area
65411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * at the point of contact for the given pointer index. */
65511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
65611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
65711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current length of the minor axis of an ellipse that describes the touch area
65811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * at the point of contact for the given pointer index. */
65911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
66011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
66111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current length of the major axis of an ellipse that describes the size
66211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * of the approaching tool for the given pointer index.
66311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The tool area represents the estimated size of the finger or pen that is
66411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touching the device independent of its actual touch area at the point of contact. */
66511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
66611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
66711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current length of the minor axis of an ellipse that describes the size
66811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * of the approaching tool for the given pointer index.
66911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The tool area represents the estimated size of the finger or pen that is
67011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touching the device independent of its actual touch area at the point of contact. */
67111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
67211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
67311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current orientation of the touch area and tool area in radians clockwise from
67411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * vertical for the given pointer index.
67511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * An angle of 0 degrees indicates that the major axis of contact is oriented
67611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * upwards, is perfectly circular or is of unknown orientation.  A positive angle
67711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * indicates that the major axis of contact is oriented to the right.  A negative angle
67811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * indicates that the major axis of contact is oriented to the left.
67911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
68011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * (finger pointing fully right). */
68111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
68211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
68311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the value of the request axis for the given pointer index. */
68411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getAxisValue(const AInputEvent* motion_event,
68511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        int32_t axis, size_t pointer_index) __NDK_FPABI__;
68611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
68711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the number of historical points in this event.  These are movements that
68811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * have occurred between this event and the previous event.  This only applies
68911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * to AMOTION_EVENT_ACTION_MOVE events -- all other actions will have a size of 0.
69011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Historical samples are indexed from oldest to newest. */
69111cd02dfb91661c65134cac258cf5924270e9d2Dan Albertsize_t AMotionEvent_getHistorySize(const AInputEvent* motion_event);
69211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
69311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the time that a historical movement occurred between this event and
69411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * the previous event, in the java.lang.System.nanoTime() time base. */
69511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event,
69611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index);
69711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
69811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical raw X coordinate of this event for the given pointer index that
69911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
70011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the original location of the event
70111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * on the screen, before it had been adjusted for the containing window
70211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views.
70311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
70411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
70511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index,
70611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
70711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
70811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical raw Y coordinate of this event for the given pointer index that
70911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
71011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * For touch events on the screen, this is the original location of the event
71111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * on the screen, before it had been adjusted for the containing window
71211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and views.
71311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
71411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
71511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index,
71611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
71711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
71811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical X coordinate of this event for the given pointer index that
71911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
72011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
72111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
72211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index,
72311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
72411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
72511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical Y coordinate of this event for the given pointer index that
72611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
72711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Whole numbers are pixels; the value may have a fraction for input devices
72811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that are sub-pixel precise. */
72911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index,
73011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
73111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
73211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical pressure of this event for the given pointer index that
73311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
73411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
73511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * although values higher than 1 may be generated depending on the calibration of
73611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * the input device. */
73711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index,
73811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
73911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
74011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the current scaled value of the approximate size for the given pointer index that
74111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
74211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * This represents some approximation of the area of the screen being
74311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * pressed; the actual value in pixels corresponding to the
74411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touch is normalized with the device specific range of values
74511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * and scaled to a value between 0 and 1.  The value of size can be used to
74611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * determine fat touch events. */
74711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index,
74811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
74911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
75011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical length of the major axis of an ellipse that describes the touch area
75111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * at the point of contact for the given pointer index that
75211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event. */
75311cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index,
75411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
75511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
75611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical length of the minor axis of an ellipse that describes the touch area
75711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * at the point of contact for the given pointer index that
75811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event. */
75911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index,
76011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
76111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
76211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical length of the major axis of an ellipse that describes the size
76311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * of the approaching tool for the given pointer index that
76411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
76511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The tool area represents the estimated size of the finger or pen that is
76611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touching the device independent of its actual touch area at the point of contact. */
76711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index,
76811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
76911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
77011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical length of the minor axis of an ellipse that describes the size
77111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * of the approaching tool for the given pointer index that
77211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
77311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The tool area represents the estimated size of the finger or pen that is
77411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * touching the device independent of its actual touch area at the point of contact. */
77511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index,
77611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
77711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
77811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical orientation of the touch area and tool area in radians clockwise from
77911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * vertical for the given pointer index that
78011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * occurred between this event and the previous motion event.
78111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * An angle of 0 degrees indicates that the major axis of contact is oriented
78211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * upwards, is perfectly circular or is of unknown orientation.  A positive angle
78311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * indicates that the major axis of contact is oriented to the right.  A negative angle
78411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * indicates that the major axis of contact is oriented to the left.
78511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
78611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * (finger pointing fully right). */
78711cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
78811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        size_t history_index) __NDK_FPABI__;
78911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
79011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* Get the historical value of the request axis for the given pointer index
79111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * that occurred between this event and the previous motion event. */
79211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertfloat AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
79311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        int32_t axis, size_t pointer_index, size_t history_index) __NDK_FPABI__;
79411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
79511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
79611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
79711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Input queue
79811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert *
79911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * An input queue is the facility through which you retrieve input
80011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * events.
80111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
80211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertstruct AInputQueue;
80311cd02dfb91661c65134cac258cf5924270e9d2Dan Alberttypedef struct AInputQueue AInputQueue;
80411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
80511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
80611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Add this input queue to a looper for processing.  See
80711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * ALooper_addFd() for information on the ident, callback, and data params.
80811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
80911cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper,
81011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert        int ident, ALooper_callbackFunc callback, void* data);
81111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
81211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
81311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Remove the input queue from the looper it is currently attached to.
81411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
81511cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid AInputQueue_detachLooper(AInputQueue* queue);
81611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
81711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
81811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Returns true if there are one or more events available in the
81911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * input queue.  Returns 1 if the queue has events; 0 if
82011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * it does not have events; and a negative value if there is an error.
82111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
82211cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputQueue_hasEvents(AInputQueue* queue);
82311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
82411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
82511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Returns the next available event from the queue.  Returns a negative
82611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * value if no events are available or an error has occurred.
82711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
82811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
82911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
83011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
83111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Sends the key for standard pre-dispatching -- that is, possibly deliver
83211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * it to the current IME to be consumed before the app.  Returns 0 if it
83311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * was not pre-dispatched, meaning you can process it right now.  If non-zero
83411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * is returned, you must abandon the current event processing and allow the
83511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * event to appear again in the event queue (if it does not get consumed during
83611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * pre-dispatching).
83711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
83811cd02dfb91661c65134cac258cf5924270e9d2Dan Albertint32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
83911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
84011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/*
84111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * Report that dispatching has finished with the given event.
84211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert * This must be called after receiving an event with AInputQueue_get_event().
84311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert */
84411cd02dfb91661c65134cac258cf5924270e9d2Dan Albertvoid AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled);
84511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
84611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#ifdef __cplusplus
84711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert}
84811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif
84911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert
85011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#endif // _ANDROID_INPUT_H
851