diff options
Diffstat (limited to '9/platforms/android-14/arch-x86/usr/include/android/input.h')
-rw-r--r-- | 9/platforms/android-14/arch-x86/usr/include/android/input.h | 240 |
1 files changed, 200 insertions, 40 deletions
diff --git a/9/platforms/android-14/arch-x86/usr/include/android/input.h b/9/platforms/android-14/arch-x86/usr/include/android/input.h index b9dffad..ac7bcc0 100644 --- a/9/platforms/android-14/arch-x86/usr/include/android/input.h +++ b/9/platforms/android-14/arch-x86/usr/include/android/input.h @@ -93,7 +93,37 @@ enum { AMETA_SHIFT_RIGHT_ON = 0x80, /* This mask is used to check whether the SYM meta key is pressed. */ - AMETA_SYM_ON = 0x04 + AMETA_SYM_ON = 0x04, + + /* This mask is used to check whether the FUNCTION meta key is pressed. */ + AMETA_FUNCTION_ON = 0x08, + + /* This mask is used to check whether one of the CTRL meta keys is pressed. */ + AMETA_CTRL_ON = 0x1000, + + /* This mask is used to check whether the left CTRL meta key is pressed. */ + AMETA_CTRL_LEFT_ON = 0x2000, + + /* This mask is used to check whether the right CTRL meta key is pressed. */ + AMETA_CTRL_RIGHT_ON = 0x4000, + + /* This mask is used to check whether one of the META meta keys is pressed. */ + AMETA_META_ON = 0x10000, + + /* This mask is used to check whether the left META meta key is pressed. */ + AMETA_META_LEFT_ON = 0x20000, + + /* This mask is used to check whether the right META meta key is pressed. */ + AMETA_META_RIGHT_ON = 0x40000, + + /* This mask is used to check whether the CAPS LOCK meta key is on. */ + AMETA_CAPS_LOCK_ON = 0x100000, + + /* This mask is used to check whether the NUM LOCK meta key is on. */ + AMETA_NUM_LOCK_ON = 0x200000, + + /* This mask is used to check whether the SCROLL LOCK meta key is on. */ + AMETA_SCROLL_LOCK_ON = 0x400000, }; /* @@ -185,7 +215,15 @@ enum { * tracked from its initial down. That is, somebody requested that tracking * started on the key down and a long press has not caused * the tracking to be canceled. */ - AKEY_EVENT_FLAG_TRACKING = 0x200 + AKEY_EVENT_FLAG_TRACKING = 0x200, + + /* Set when a key event has been synthesized to implement default behavior + * for an event that the application did not handle. + * Fallback key events are generated by unhandled trackball motions + * (to emulate a directional keypad) and by certain unhandled key presses + * that are declared in the key map (such as special function numeric keypad + * keys when numlock is off). */ + AKEY_EVENT_FLAG_FALLBACK = 0x400, }; /* @@ -243,7 +281,30 @@ enum { /* A non-primary pointer has gone up. * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed. */ - AMOTION_EVENT_ACTION_POINTER_UP = 6 + AMOTION_EVENT_ACTION_POINTER_UP = 6, + + /* A change happened but the pointer is not down (unlike AMOTION_EVENT_ACTION_MOVE). + * The motion contains the most recent point, as well as any intermediate points since + * the last hover move event. + */ + AMOTION_EVENT_ACTION_HOVER_MOVE = 7, + + /* The motion event contains relative vertical and/or horizontal scroll offsets. + * Use getAxisValue to retrieve the information from AMOTION_EVENT_AXIS_VSCROLL + * and AMOTION_EVENT_AXIS_HSCROLL. + * The pointer may or may not be down when this event is dispatched. + * This action is always delivered to the winder under the pointer, which + * may not be the window currently touched. + */ + AMOTION_EVENT_ACTION_SCROLL = 8, + + /* The pointer is not down but has entered the boundaries of a window or view. + */ + AMOTION_EVENT_ACTION_HOVER_ENTER = 9, + + /* The pointer is not down but has exited the boundaries of a window or view. + */ + AMOTION_EVENT_ACTION_HOVER_EXIT = 10, }; /* @@ -283,6 +344,82 @@ enum { }; /* + * Constants that identify each individual axis of a motion event. + * Refer to the documentation on the MotionEvent class for descriptions of each axis. + */ +enum { + AMOTION_EVENT_AXIS_X = 0, + AMOTION_EVENT_AXIS_Y = 1, + AMOTION_EVENT_AXIS_PRESSURE = 2, + AMOTION_EVENT_AXIS_SIZE = 3, + AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4, + AMOTION_EVENT_AXIS_TOUCH_MINOR = 5, + AMOTION_EVENT_AXIS_TOOL_MAJOR = 6, + AMOTION_EVENT_AXIS_TOOL_MINOR = 7, + AMOTION_EVENT_AXIS_ORIENTATION = 8, + AMOTION_EVENT_AXIS_VSCROLL = 9, + AMOTION_EVENT_AXIS_HSCROLL = 10, + AMOTION_EVENT_AXIS_Z = 11, + AMOTION_EVENT_AXIS_RX = 12, + AMOTION_EVENT_AXIS_RY = 13, + AMOTION_EVENT_AXIS_RZ = 14, + AMOTION_EVENT_AXIS_HAT_X = 15, + AMOTION_EVENT_AXIS_HAT_Y = 16, + AMOTION_EVENT_AXIS_LTRIGGER = 17, + AMOTION_EVENT_AXIS_RTRIGGER = 18, + AMOTION_EVENT_AXIS_THROTTLE = 19, + AMOTION_EVENT_AXIS_RUDDER = 20, + AMOTION_EVENT_AXIS_WHEEL = 21, + AMOTION_EVENT_AXIS_GAS = 22, + AMOTION_EVENT_AXIS_BRAKE = 23, + AMOTION_EVENT_AXIS_DISTANCE = 24, + AMOTION_EVENT_AXIS_TILT = 25, + AMOTION_EVENT_AXIS_GENERIC_1 = 32, + AMOTION_EVENT_AXIS_GENERIC_2 = 33, + AMOTION_EVENT_AXIS_GENERIC_3 = 34, + AMOTION_EVENT_AXIS_GENERIC_4 = 35, + AMOTION_EVENT_AXIS_GENERIC_5 = 36, + AMOTION_EVENT_AXIS_GENERIC_6 = 37, + AMOTION_EVENT_AXIS_GENERIC_7 = 38, + AMOTION_EVENT_AXIS_GENERIC_8 = 39, + AMOTION_EVENT_AXIS_GENERIC_9 = 40, + AMOTION_EVENT_AXIS_GENERIC_10 = 41, + AMOTION_EVENT_AXIS_GENERIC_11 = 42, + AMOTION_EVENT_AXIS_GENERIC_12 = 43, + AMOTION_EVENT_AXIS_GENERIC_13 = 44, + AMOTION_EVENT_AXIS_GENERIC_14 = 45, + AMOTION_EVENT_AXIS_GENERIC_15 = 46, + AMOTION_EVENT_AXIS_GENERIC_16 = 47, + + // NOTE: If you add a new axis here you must also add it to several other files. + // Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list. +}; + +/* + * Constants that identify buttons that are associated with motion events. + * Refer to the documentation on the MotionEvent class for descriptions of each button. + */ +enum { + AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0, + AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1, + AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2, + AMOTION_EVENT_BUTTON_BACK = 1 << 3, + AMOTION_EVENT_BUTTON_FORWARD = 1 << 4, +}; + +/* + * Constants that identify tool types. + * Refer to the documentation on the MotionEvent class for descriptions of each tool type. + */ +enum { + AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0, + AMOTION_EVENT_TOOL_TYPE_FINGER = 1, + AMOTION_EVENT_TOOL_TYPE_STYLUS = 2, + AMOTION_EVENT_TOOL_TYPE_MOUSE = 3, + AMOTION_EVENT_TOOL_TYPE_ERASER = 4, +}; + +/* * Input sources. * * Refer to the documentation on android.view.InputDevice for more details about input sources @@ -295,6 +432,7 @@ enum { AINPUT_SOURCE_CLASS_POINTER = 0x00000002, AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004, AINPUT_SOURCE_CLASS_POSITION = 0x00000008, + AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010, }; enum { @@ -302,10 +440,13 @@ enum { AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON, AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON, + AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON, AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER, AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER, + AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER, AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION, AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION, + AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK, AINPUT_SOURCE_ANY = 0xffffff00, }; @@ -327,18 +468,20 @@ enum { * * Refer to the documentation on android.view.InputDevice for more details about input sources * and their correct interpretation. + * + * DEPRECATION NOTICE: These constants are deprecated. Use AMOTION_EVENT_AXIS_* constants instead. */ enum { - AINPUT_MOTION_RANGE_X = 0, - AINPUT_MOTION_RANGE_Y = 1, - AINPUT_MOTION_RANGE_PRESSURE = 2, - AINPUT_MOTION_RANGE_SIZE = 3, - AINPUT_MOTION_RANGE_TOUCH_MAJOR = 4, - AINPUT_MOTION_RANGE_TOUCH_MINOR = 5, - AINPUT_MOTION_RANGE_TOOL_MAJOR = 6, - AINPUT_MOTION_RANGE_TOOL_MINOR = 7, - AINPUT_MOTION_RANGE_ORIENTATION = 8, -}; + AINPUT_MOTION_RANGE_X = AMOTION_EVENT_AXIS_X, + AINPUT_MOTION_RANGE_Y = AMOTION_EVENT_AXIS_Y, + AINPUT_MOTION_RANGE_PRESSURE = AMOTION_EVENT_AXIS_PRESSURE, + AINPUT_MOTION_RANGE_SIZE = AMOTION_EVENT_AXIS_SIZE, + AINPUT_MOTION_RANGE_TOUCH_MAJOR = AMOTION_EVENT_AXIS_TOUCH_MAJOR, + AINPUT_MOTION_RANGE_TOUCH_MINOR = AMOTION_EVENT_AXIS_TOUCH_MINOR, + AINPUT_MOTION_RANGE_TOOL_MAJOR = AMOTION_EVENT_AXIS_TOOL_MAJOR, + AINPUT_MOTION_RANGE_TOOL_MINOR = AMOTION_EVENT_AXIS_TOOL_MINOR, + AINPUT_MOTION_RANGE_ORIENTATION = AMOTION_EVENT_AXIS_ORIENTATION, +} __attribute__ ((deprecated)); /* @@ -416,6 +559,9 @@ int32_t AMotionEvent_getFlags(const AInputEvent* motion_event); * event was generated. */ int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event); +/* Get the button state of all buttons that are pressed. */ +int32_t AMotionEvent_getButtonState(const AInputEvent* motion_event); + /* Get a bitfield indicating which edges, if any, were touched by this motion event. * For touch events, clients can use this to determine if the user's finger was * touching the edge of the display. */ @@ -433,61 +579,66 @@ int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event); * For touch events on the screen, this is the delta that was added to the raw * screen coordinates to adjust for the absolute position of the containing windows * and views. */ -float AMotionEvent_getXOffset(const AInputEvent* motion_event); +float AMotionEvent_getXOffset(const AInputEvent* motion_event) __NDK_FPABI__; /* Get the precision of the Y coordinates being reported. * For touch events on the screen, this is the delta that was added to the raw * screen coordinates to adjust for the absolute position of the containing windows * and views. */ -float AMotionEvent_getYOffset(const AInputEvent* motion_event); +float AMotionEvent_getYOffset(const AInputEvent* motion_event) __NDK_FPABI__; /* Get the precision of the X coordinates being reported. * You can multiply this number with an X coordinate sample to find the * actual hardware value of the X coordinate. */ -float AMotionEvent_getXPrecision(const AInputEvent* motion_event); +float AMotionEvent_getXPrecision(const AInputEvent* motion_event) __NDK_FPABI__; /* Get the precision of the Y coordinates being reported. * You can multiply this number with a Y coordinate sample to find the * actual hardware value of the Y coordinate. */ -float AMotionEvent_getYPrecision(const AInputEvent* motion_event); +float AMotionEvent_getYPrecision(const AInputEvent* motion_event) __NDK_FPABI__; /* Get the number of pointers of data contained in this event. * Always >= 1. */ size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event); /* Get the pointer identifier associated with a particular pointer - * data index is this event. The identifier tells you the actual pointer + * data index in this event. The identifier tells you the actual pointer * number associated with the data, accounting for individual pointers * going up and down since the start of the current gesture. */ int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index); +/* Get the tool type of a pointer for the given pointer index. + * The tool type indicates the type of tool used to make contact such as a + * finger or stylus, if known. */ +int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer_index); + /* Get the original raw X coordinate of this event. * For touch events on the screen, this is the original location of the event * on the screen, before it had been adjusted for the containing window * and views. */ -float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the original raw X coordinate of this event. * For touch events on the screen, this is the original location of the event * on the screen, before it had been adjusted for the containing window * and views. */ -float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current X coordinate of this event for the given pointer index. * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ -float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current Y coordinate of this event for the given pointer index. * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ -float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current pressure of this event for the given pointer index. * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), * although values higher than 1 may be generated depending on the calibration of * the input device. */ -float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current scaled value of the approximate size for the given pointer index. * This represents some approximation of the area of the screen being @@ -495,27 +646,27 @@ float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_i * touch is normalized with the device specific range of values * and scaled to a value between 0 and 1. The value of size can be used to * determine fat touch events. */ -float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current length of the major axis of an ellipse that describes the touch area * at the point of contact for the given pointer index. */ -float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current length of the minor axis of an ellipse that describes the touch area * at the point of contact for the given pointer index. */ -float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current length of the major axis of an ellipse that describes the size * of the approaching tool for the given pointer index. * The tool area represents the estimated size of the finger or pen that is * touching the device independent of its actual touch area at the point of contact. */ -float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current length of the minor axis of an ellipse that describes the size * of the approaching tool for the given pointer index. * The tool area represents the estimated size of the finger or pen that is * touching the device independent of its actual touch area at the point of contact. */ -float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; /* Get the current orientation of the touch area and tool area in radians clockwise from * vertical for the given pointer index. @@ -525,7 +676,11 @@ float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_ * indicates that the major axis of contact is oriented to the left. * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians * (finger pointing fully right). */ -float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index); +float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__; + +/* Get the value of the request axis for the given pointer index. */ +float AMotionEvent_getAxisValue(const AInputEvent* motion_event, + int32_t axis, size_t pointer_index) __NDK_FPABI__; /* Get the number of historical points in this event. These are movements that * have occurred between this event and the previous event. This only applies @@ -546,7 +701,7 @@ int64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event, * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical raw Y coordinate of this event for the given pointer index that * occurred between this event and the previous motion event. @@ -556,21 +711,21 @@ float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t poi * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical X coordinate of this event for the given pointer index that * occurred between this event and the previous motion event. * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ float AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical Y coordinate of this event for the given pointer index that * occurred between this event and the previous motion event. * Whole numbers are pixels; the value may have a fraction for input devices * that are sub-pixel precise. */ float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical pressure of this event for the given pointer index that * occurred between this event and the previous motion event. @@ -578,7 +733,7 @@ float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointe * although values higher than 1 may be generated depending on the calibration of * the input device. */ float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the current scaled value of the approximate size for the given pointer index that * occurred between this event and the previous motion event. @@ -588,19 +743,19 @@ float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t * and scaled to a value between 0 and 1. The value of size can be used to * determine fat touch events. */ float AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical length of the major axis of an ellipse that describes the touch area * at the point of contact for the given pointer index that * occurred between this event and the previous motion event. */ float AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical length of the minor axis of an ellipse that describes the touch area * at the point of contact for the given pointer index that * occurred between this event and the previous motion event. */ float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical length of the major axis of an ellipse that describes the size * of the approaching tool for the given pointer index that @@ -608,7 +763,7 @@ float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size * The tool area represents the estimated size of the finger or pen that is * touching the device independent of its actual touch area at the point of contact. */ float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical length of the minor axis of an ellipse that describes the size * of the approaching tool for the given pointer index that @@ -616,7 +771,7 @@ float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_ * The tool area represents the estimated size of the finger or pen that is * touching the device independent of its actual touch area at the point of contact. */ float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; /* Get the historical orientation of the touch area and tool area in radians clockwise from * vertical for the given pointer index that @@ -628,7 +783,12 @@ float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_ * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians * (finger pointing fully right). */ float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index, - size_t history_index); + size_t history_index) __NDK_FPABI__; + +/* Get the historical value of the request axis for the given pointer index + * that occurred between this event and the previous motion event. */ +float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event, + int32_t axis, size_t pointer_index, size_t history_index) __NDK_FPABI__; /* |