| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826 |
- // copied from <https://android.googlesource.com/platform/frameworks/native/+/master/include/android/input.h>
- // blob 08299899b6305a0fe74d7d2b8471b7cd0af49dc7
- // (and modified)
- /*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- #ifndef _ANDROID_INPUT_H
- #define _ANDROID_INPUT_H
- /**
- * Meta key / modifer state.
- */
- enum AndroidMetastate {
- /** No meta keys are pressed. */
- AMETA_NONE = 0,
- /** This mask is used to check whether one of the ALT meta keys is pressed. */
- AMETA_ALT_ON = 0x02,
- /** This mask is used to check whether the left ALT meta key is pressed. */
- AMETA_ALT_LEFT_ON = 0x10,
- /** This mask is used to check whether the right ALT meta key is pressed. */
- AMETA_ALT_RIGHT_ON = 0x20,
- /** This mask is used to check whether one of the SHIFT meta keys is pressed. */
- AMETA_SHIFT_ON = 0x01,
- /** This mask is used to check whether the left SHIFT meta key is pressed. */
- AMETA_SHIFT_LEFT_ON = 0x40,
- /** This mask is used to check whether the right SHIFT meta key is pressed. */
- AMETA_SHIFT_RIGHT_ON = 0x80,
- /** This mask is used to check whether the SYM meta key is pressed. */
- 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,
- };
- /**
- * Input event types.
- */
- enum AndroidInputEventType {
- /** Indicates that the input event is a key event. */
- AINPUT_EVENT_TYPE_KEY = 1,
- /** Indicates that the input event is a motion event. */
- AINPUT_EVENT_TYPE_MOTION = 2
- };
- /**
- * Key event actions.
- */
- enum AndroidKeyeventAction {
- /** The key has been pressed down. */
- AKEY_EVENT_ACTION_DOWN = 0,
- /** The key has been released. */
- AKEY_EVENT_ACTION_UP = 1,
- /**
- * Multiple duplicate key events have occurred in a row, or a
- * complex string is being delivered. The repeat_count property
- * of the key event contains the number of times the given key
- * code should be executed.
- */
- AKEY_EVENT_ACTION_MULTIPLE = 2
- };
- /**
- * Key event flags.
- */
- enum AndroidKeyeventFlags {
- /** This mask is set if the device woke because of this key event. */
- AKEY_EVENT_FLAG_WOKE_HERE = 0x1,
- /** This mask is set if the key event was generated by a software keyboard. */
- AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2,
- /** This mask is set if we don't want the key event to cause us to leave touch mode. */
- AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4,
- /**
- * This mask is set if an event was known to come from a trusted
- * part of the system. That is, the event is known to come from
- * the user, and could not have been spoofed by a third party
- * component.
- */
- AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8,
- /**
- * This mask is used for compatibility, to identify enter keys that are
- * coming from an IME whose enter key has been auto-labelled "next" or
- * "done". This allows TextView to dispatch these as normal enter keys
- * for old applications, but still do the appropriate action when
- * receiving them.
- */
- AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10,
- /**
- * When associated with up key events, this indicates that the key press
- * has been canceled. Typically this is used with virtual touch screen
- * keys, where the user can slide from the virtual key area on to the
- * display: in that case, the application will receive a canceled up
- * event and should not perform the action normally associated with the
- * key. Note that for this to work, the application can not perform an
- * action for a key until it receives an up or the long press timeout has
- * expired.
- */
- AKEY_EVENT_FLAG_CANCELED = 0x20,
- /**
- * This key event was generated by a virtual (on-screen) hard key area.
- * Typically this is an area of the touchscreen, outside of the regular
- * display, dedicated to "hardware" buttons.
- */
- AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40,
- /**
- * This flag is set for the first key repeat that occurs after the
- * long press timeout.
- */
- AKEY_EVENT_FLAG_LONG_PRESS = 0x80,
- /**
- * Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
- * press action was executed while it was down.
- */
- AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100,
- /**
- * Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
- * 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,
- /**
- * 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,
- };
- /**
- * Bit shift for the action bits holding the pointer index as
- * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
- */
- #define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
- /** Motion event actions */
- enum AndroidMotioneventAction {
- /** Bit mask of the parts of the action code that are the action itself. */
- AMOTION_EVENT_ACTION_MASK = 0xff,
- /**
- * Bits in the action code that represent a pointer index, used with
- * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP. Shifting
- * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
- * index where the data for the pointer going up or down can be found.
- */
- AMOTION_EVENT_ACTION_POINTER_INDEX_MASK = 0xff00,
- /** A pressed gesture has started, the motion contains the initial starting location. */
- AMOTION_EVENT_ACTION_DOWN = 0,
- /**
- * A pressed gesture has finished, the motion contains the final release location
- * as well as any intermediate points since the last down or move event.
- */
- AMOTION_EVENT_ACTION_UP = 1,
- /**
- * A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
- * AMOTION_EVENT_ACTION_UP). The motion contains the most recent point, as well as
- * any intermediate points since the last down or move event.
- */
- AMOTION_EVENT_ACTION_MOVE = 2,
- /**
- * The current gesture has been aborted.
- * You will not receive any more points in it. You should treat this as
- * an up event, but not perform any action that you normally would.
- */
- AMOTION_EVENT_ACTION_CANCEL = 3,
- /**
- * A movement has happened outside of the normal bounds of the UI element.
- * This does not provide a full gesture, but only the initial location of the movement/touch.
- */
- AMOTION_EVENT_ACTION_OUTSIDE = 4,
- /**
- * A non-primary pointer has gone down.
- * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
- */
- AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
- /**
- * 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,
- /**
- * 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,
- /* One or more buttons have been pressed. */
- AMOTION_EVENT_ACTION_BUTTON_PRESS = 11,
- /* One or more buttons have been released. */
- AMOTION_EVENT_ACTION_BUTTON_RELEASE = 12,
- };
- /**
- * Motion event flags.
- */
- enum AndroidMotioneventFlags {
- /**
- * This flag indicates that the window that received this motion event is partly
- * or wholly obscured by another visible window above it. This flag is set to true
- * even if the event did not directly pass through the obscured area.
- * A security sensitive application can check this flag to identify situations in which
- * a malicious application may have covered up part of its content for the purpose
- * of misleading the user or hijacking touches. An appropriate response might be
- * to drop the suspect touches or to take additional precautions to confirm the user's
- * actual intent.
- */
- AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1,
- };
- /**
- * Motion event edge touch flags.
- */
- enum AndroidMotioneventEdgeTouchTlags {
- /** No edges intersected. */
- AMOTION_EVENT_EDGE_FLAG_NONE = 0,
- /** Flag indicating the motion event intersected the top edge of the screen. */
- AMOTION_EVENT_EDGE_FLAG_TOP = 0x01,
- /** Flag indicating the motion event intersected the bottom edge of the screen. */
- AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02,
- /** Flag indicating the motion event intersected the left edge of the screen. */
- AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04,
- /** Flag indicating the motion event intersected the right edge of the screen. */
- AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08
- };
- /**
- * Constants that identify each individual axis of a motion event.
- * @anchor AMOTION_EVENT_AXIS
- */
- enum AndroidMotioneventAxis {
- /**
- * Axis constant: X axis of a motion event.
- *
- * - For a touch screen, reports the absolute X screen position of the center of
- * the touch contact area. The units are display pixels.
- * - For a touch pad, reports the absolute X surface position of the center of the touch
- * contact area. The units are device-dependent.
- * - For a mouse, reports the absolute X screen position of the mouse pointer.
- * The units are display pixels.
- * - For a trackball, reports the relative horizontal displacement of the trackball.
- * The value is normalized to a range from -1.0 (left) to 1.0 (right).
- * - For a joystick, reports the absolute X position of the joystick.
- * The value is normalized to a range from -1.0 (left) to 1.0 (right).
- */
- AMOTION_EVENT_AXIS_X = 0,
- /**
- * Axis constant: Y axis of a motion event.
- *
- * - For a touch screen, reports the absolute Y screen position of the center of
- * the touch contact area. The units are display pixels.
- * - For a touch pad, reports the absolute Y surface position of the center of the touch
- * contact area. The units are device-dependent.
- * - For a mouse, reports the absolute Y screen position of the mouse pointer.
- * The units are display pixels.
- * - For a trackball, reports the relative vertical displacement of the trackball.
- * The value is normalized to a range from -1.0 (up) to 1.0 (down).
- * - For a joystick, reports the absolute Y position of the joystick.
- * The value is normalized to a range from -1.0 (up or far) to 1.0 (down or near).
- */
- AMOTION_EVENT_AXIS_Y = 1,
- /**
- * Axis constant: Pressure axis of a motion event.
- *
- * - For a touch screen or touch pad, reports the approximate pressure applied to the surface
- * by a finger or other tool. The value is normalized to a range 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.
- * - For a trackball, the value is set to 1 if the trackball button is pressed
- * or 0 otherwise.
- * - For a mouse, the value is set to 1 if the primary mouse button is pressed
- * or 0 otherwise.
- */
- AMOTION_EVENT_AXIS_PRESSURE = 2,
- /**
- * Axis constant: Size axis of a motion event.
- *
- * - For a touch screen or touch pad, reports the approximate size of the contact area in
- * relation to the maximum detectable size for the device. The value is normalized
- * to a range from 0 (smallest detectable size) to 1 (largest detectable size),
- * although it is not a linear scale. This value is of limited use.
- * To obtain calibrated size information, see
- * {@link AMOTION_EVENT_AXIS_TOUCH_MAJOR} or {@link AMOTION_EVENT_AXIS_TOOL_MAJOR}.
- */
- AMOTION_EVENT_AXIS_SIZE = 3,
- /**
- * Axis constant: TouchMajor axis of a motion event.
- *
- * - For a touch screen, reports the length of the major axis of an ellipse that
- * represents the touch area at the point of contact.
- * The units are display pixels.
- * - For a touch pad, reports the length of the major axis of an ellipse that
- * represents the touch area at the point of contact.
- * The units are device-dependent.
- */
- AMOTION_EVENT_AXIS_TOUCH_MAJOR = 4,
- /**
- * Axis constant: TouchMinor axis of a motion event.
- *
- * - For a touch screen, reports the length of the minor axis of an ellipse that
- * represents the touch area at the point of contact.
- * The units are display pixels.
- * - For a touch pad, reports the length of the minor axis of an ellipse that
- * represents the touch area at the point of contact.
- * The units are device-dependent.
- *
- * When the touch is circular, the major and minor axis lengths will be equal to one another.
- */
- AMOTION_EVENT_AXIS_TOUCH_MINOR = 5,
- /**
- * Axis constant: ToolMajor axis of a motion event.
- *
- * - For a touch screen, reports the length of the major axis of an ellipse that
- * represents the size of the approaching finger or tool used to make contact.
- * - For a touch pad, reports the length of the major axis of an ellipse that
- * represents the size of the approaching finger or tool used to make contact.
- * The units are device-dependent.
- *
- * When the touch is circular, the major and minor axis lengths will be equal to one another.
- *
- * The tool size may be larger than the touch size since the tool may not be fully
- * in contact with the touch sensor.
- */
- AMOTION_EVENT_AXIS_TOOL_MAJOR = 6,
- /**
- * Axis constant: ToolMinor axis of a motion event.
- *
- * - For a touch screen, reports the length of the minor axis of an ellipse that
- * represents the size of the approaching finger or tool used to make contact.
- * - For a touch pad, reports the length of the minor axis of an ellipse that
- * represents the size of the approaching finger or tool used to make contact.
- * The units are device-dependent.
- *
- * When the touch is circular, the major and minor axis lengths will be equal to one another.
- *
- * The tool size may be larger than the touch size since the tool may not be fully
- * in contact with the touch sensor.
- */
- AMOTION_EVENT_AXIS_TOOL_MINOR = 7,
- /**
- * Axis constant: Orientation axis of a motion event.
- *
- * - For a touch screen or touch pad, reports the orientation of the finger
- * or tool in radians relative to the vertical plane of the device.
- * An angle of 0 radians indicates that the major axis of contact is oriented
- * upwards, is perfectly circular or is of unknown orientation. A positive angle
- * indicates that the major axis of contact is oriented to the right. A negative angle
- * 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).
- * - For a stylus, the orientation indicates the direction in which the stylus
- * is pointing in relation to the vertical axis of the current orientation of the screen.
- * The range is from -PI radians to PI radians, where 0 is pointing up,
- * -PI/2 radians is pointing left, -PI or PI radians is pointing down, and PI/2 radians
- * is pointing right. See also {@link AMOTION_EVENT_AXIS_TILT}.
- */
- AMOTION_EVENT_AXIS_ORIENTATION = 8,
- /**
- * Axis constant: Vertical Scroll axis of a motion event.
- *
- * - For a mouse, reports the relative movement of the vertical scroll wheel.
- * The value is normalized to a range from -1.0 (down) to 1.0 (up).
- *
- * This axis should be used to scroll views vertically.
- */
- AMOTION_EVENT_AXIS_VSCROLL = 9,
- /**
- * Axis constant: Horizontal Scroll axis of a motion event.
- *
- * - For a mouse, reports the relative movement of the horizontal scroll wheel.
- * The value is normalized to a range from -1.0 (left) to 1.0 (right).
- *
- * This axis should be used to scroll views horizontally.
- */
- AMOTION_EVENT_AXIS_HSCROLL = 10,
- /**
- * Axis constant: Z axis of a motion event.
- *
- * - For a joystick, reports the absolute Z position of the joystick.
- * The value is normalized to a range from -1.0 (high) to 1.0 (low).
- * <em>On game pads with two analog joysticks, this axis is often reinterpreted
- * to report the absolute X position of the second joystick instead.</em>
- */
- AMOTION_EVENT_AXIS_Z = 11,
- /**
- * Axis constant: X Rotation axis of a motion event.
- *
- * - For a joystick, reports the absolute rotation angle about the X axis.
- * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
- */
- AMOTION_EVENT_AXIS_RX = 12,
- /**
- * Axis constant: Y Rotation axis of a motion event.
- *
- * - For a joystick, reports the absolute rotation angle about the Y axis.
- * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
- */
- AMOTION_EVENT_AXIS_RY = 13,
- /**
- * Axis constant: Z Rotation axis of a motion event.
- *
- * - For a joystick, reports the absolute rotation angle about the Z axis.
- * The value is normalized to a range from -1.0 (counter-clockwise) to 1.0 (clockwise).
- * On game pads with two analog joysticks, this axis is often reinterpreted
- * to report the absolute Y position of the second joystick instead.
- */
- AMOTION_EVENT_AXIS_RZ = 14,
- /**
- * Axis constant: Hat X axis of a motion event.
- *
- * - For a joystick, reports the absolute X position of the directional hat control.
- * The value is normalized to a range from -1.0 (left) to 1.0 (right).
- */
- AMOTION_EVENT_AXIS_HAT_X = 15,
- /**
- * Axis constant: Hat Y axis of a motion event.
- *
- * - For a joystick, reports the absolute Y position of the directional hat control.
- * The value is normalized to a range from -1.0 (up) to 1.0 (down).
- */
- AMOTION_EVENT_AXIS_HAT_Y = 16,
- /**
- * Axis constant: Left Trigger axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the left trigger control.
- * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed).
- */
- AMOTION_EVENT_AXIS_LTRIGGER = 17,
- /**
- * Axis constant: Right Trigger axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the right trigger control.
- * The value is normalized to a range from 0.0 (released) to 1.0 (fully pressed).
- */
- AMOTION_EVENT_AXIS_RTRIGGER = 18,
- /**
- * Axis constant: Throttle axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the throttle control.
- * The value is normalized to a range from 0.0 (fully open) to 1.0 (fully closed).
- */
- AMOTION_EVENT_AXIS_THROTTLE = 19,
- /**
- * Axis constant: Rudder axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the rudder control.
- * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right).
- */
- AMOTION_EVENT_AXIS_RUDDER = 20,
- /**
- * Axis constant: Wheel axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the steering wheel control.
- * The value is normalized to a range from -1.0 (turn left) to 1.0 (turn right).
- */
- AMOTION_EVENT_AXIS_WHEEL = 21,
- /**
- * Axis constant: Gas axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the gas (accelerator) control.
- * The value is normalized to a range from 0.0 (no acceleration)
- * to 1.0 (maximum acceleration).
- */
- AMOTION_EVENT_AXIS_GAS = 22,
- /**
- * Axis constant: Brake axis of a motion event.
- *
- * - For a joystick, reports the absolute position of the brake control.
- * The value is normalized to a range from 0.0 (no braking) to 1.0 (maximum braking).
- */
- AMOTION_EVENT_AXIS_BRAKE = 23,
- /**
- * Axis constant: Distance axis of a motion event.
- *
- * - For a stylus, reports the distance of the stylus from the screen.
- * A value of 0.0 indicates direct contact and larger values indicate increasing
- * distance from the surface.
- */
- AMOTION_EVENT_AXIS_DISTANCE = 24,
- /**
- * Axis constant: Tilt axis of a motion event.
- *
- * - For a stylus, reports the tilt angle of the stylus in radians where
- * 0 radians indicates that the stylus is being held perpendicular to the
- * surface, and PI/2 radians indicates that the stylus is being held flat
- * against the surface.
- */
- AMOTION_EVENT_AXIS_TILT = 25,
- /**
- * Axis constant: Generic scroll axis of a motion event.
- *
- * - This is used for scroll axis motion events that can't be classified as strictly
- * vertical or horizontal. The movement of a rotating scroller is an example of this.
- */
- AMOTION_EVENT_AXIS_SCROLL = 26,
- /**
- * Axis constant: The movement of x position of a motion event.
- *
- * - For a mouse, reports a difference of x position between the previous position.
- * This is useful when pointer is captured, in that case the mouse pointer doesn't
- * change the location but this axis reports the difference which allows the app
- * to see how the mouse is moved.
- */
- AMOTION_EVENT_AXIS_RELATIVE_X = 27,
- /**
- * Axis constant: The movement of y position of a motion event.
- *
- * Same as {@link RELATIVE_X}, but for y position.
- */
- AMOTION_EVENT_AXIS_RELATIVE_Y = 28,
- /**
- * Axis constant: Generic 1 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_1 = 32,
- /**
- * Axis constant: Generic 2 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_2 = 33,
- /**
- * Axis constant: Generic 3 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_3 = 34,
- /**
- * Axis constant: Generic 4 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_4 = 35,
- /**
- * Axis constant: Generic 5 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_5 = 36,
- /**
- * Axis constant: Generic 6 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_6 = 37,
- /**
- * Axis constant: Generic 7 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_7 = 38,
- /**
- * Axis constant: Generic 8 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_8 = 39,
- /**
- * Axis constant: Generic 9 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_9 = 40,
- /**
- * Axis constant: Generic 10 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_10 = 41,
- /**
- * Axis constant: Generic 11 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_11 = 42,
- /**
- * Axis constant: Generic 12 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_12 = 43,
- /**
- * Axis constant: Generic 13 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_13 = 44,
- /**
- * Axis constant: Generic 14 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_14 = 45,
- /**
- * Axis constant: Generic 15 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- AMOTION_EVENT_AXIS_GENERIC_15 = 46,
- /**
- * Axis constant: Generic 16 axis of a motion event.
- * The interpretation of a generic axis is device-specific.
- */
- 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 AndroidMotioneventButtons {
- /** primary */
- AMOTION_EVENT_BUTTON_PRIMARY = 1 << 0,
- /** secondary */
- AMOTION_EVENT_BUTTON_SECONDARY = 1 << 1,
- /** tertiary */
- AMOTION_EVENT_BUTTON_TERTIARY = 1 << 2,
- /** back */
- AMOTION_EVENT_BUTTON_BACK = 1 << 3,
- /** forward */
- AMOTION_EVENT_BUTTON_FORWARD = 1 << 4,
- AMOTION_EVENT_BUTTON_STYLUS_PRIMARY = 1 << 5,
- AMOTION_EVENT_BUTTON_STYLUS_SECONDARY = 1 << 6,
- };
- /**
- * Constants that identify tool types.
- * Refer to the documentation on the MotionEvent class for descriptions of each tool type.
- */
- enum AndroidMotioneventToolType {
- /** unknown */
- AMOTION_EVENT_TOOL_TYPE_UNKNOWN = 0,
- /** finger */
- AMOTION_EVENT_TOOL_TYPE_FINGER = 1,
- /** stylus */
- AMOTION_EVENT_TOOL_TYPE_STYLUS = 2,
- /** mouse */
- AMOTION_EVENT_TOOL_TYPE_MOUSE = 3,
- /** eraser */
- AMOTION_EVENT_TOOL_TYPE_ERASER = 4,
- };
- /**
- * Input source masks.
- *
- * Refer to the documentation on android.view.InputDevice for more details about input sources
- * and their correct interpretation.
- */
- enum AndroidInputSourceClass {
- /** mask */
- AINPUT_SOURCE_CLASS_MASK = 0x000000ff,
- /** none */
- AINPUT_SOURCE_CLASS_NONE = 0x00000000,
- /** button */
- AINPUT_SOURCE_CLASS_BUTTON = 0x00000001,
- /** pointer */
- AINPUT_SOURCE_CLASS_POINTER = 0x00000002,
- /** navigation */
- AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004,
- /** position */
- AINPUT_SOURCE_CLASS_POSITION = 0x00000008,
- /** joystick */
- AINPUT_SOURCE_CLASS_JOYSTICK = 0x00000010,
- };
- /**
- * Input sources.
- */
- enum AndroidInputSource {
- /** unknown */
- AINPUT_SOURCE_UNKNOWN = 0x00000000,
- /** keyboard */
- AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON,
- /** dpad */
- AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON,
- /** gamepad */
- AINPUT_SOURCE_GAMEPAD = 0x00000400 | AINPUT_SOURCE_CLASS_BUTTON,
- /** touchscreen */
- AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER,
- /** mouse */
- AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER,
- /** stylus */
- AINPUT_SOURCE_STYLUS = 0x00004000 | AINPUT_SOURCE_CLASS_POINTER,
- /** bluetooth stylus */
- AINPUT_SOURCE_BLUETOOTH_STYLUS = 0x00008000 | AINPUT_SOURCE_STYLUS,
- /** trackball */
- AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
- /** mouse relative */
- AINPUT_SOURCE_MOUSE_RELATIVE = 0x00020000 | AINPUT_SOURCE_CLASS_NAVIGATION,
- /** touchpad */
- AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
- /** navigation */
- AINPUT_SOURCE_TOUCH_NAVIGATION = 0x00200000 | AINPUT_SOURCE_CLASS_NONE,
- /** joystick */
- AINPUT_SOURCE_JOYSTICK = 0x01000000 | AINPUT_SOURCE_CLASS_JOYSTICK,
- /** rotary encoder */
- AINPUT_SOURCE_ROTARY_ENCODER = 0x00400000 | AINPUT_SOURCE_CLASS_NONE,
- };
- /**
- * Keyboard types.
- *
- * Refer to the documentation on android.view.InputDevice for more details.
- */
- enum AndroidKeyboardType {
- /** none */
- AINPUT_KEYBOARD_TYPE_NONE = 0,
- /** non alphabetic */
- AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
- /** alphabetic */
- AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2,
- };
- /**
- * Constants used to retrieve information about the range of motion for a particular
- * coordinate of a motion event.
- *
- * Refer to the documentation on android.view.InputDevice for more details about input sources
- * and their correct interpretation.
- *
- * @deprecated These constants are deprecated. Use {@link AMOTION_EVENT_AXIS AMOTION_EVENT_AXIS_*} constants instead.
- */
- enum AndroidMotionRange {
- /** x */
- AINPUT_MOTION_RANGE_X = AMOTION_EVENT_AXIS_X,
- /** y */
- AINPUT_MOTION_RANGE_Y = AMOTION_EVENT_AXIS_Y,
- /** pressure */
- AINPUT_MOTION_RANGE_PRESSURE = AMOTION_EVENT_AXIS_PRESSURE,
- /** size */
- AINPUT_MOTION_RANGE_SIZE = AMOTION_EVENT_AXIS_SIZE,
- /** touch major */
- AINPUT_MOTION_RANGE_TOUCH_MAJOR = AMOTION_EVENT_AXIS_TOUCH_MAJOR,
- /** touch minor */
- AINPUT_MOTION_RANGE_TOUCH_MINOR = AMOTION_EVENT_AXIS_TOUCH_MINOR,
- /** tool major */
- AINPUT_MOTION_RANGE_TOOL_MAJOR = AMOTION_EVENT_AXIS_TOOL_MAJOR,
- /** tool minor */
- AINPUT_MOTION_RANGE_TOOL_MINOR = AMOTION_EVENT_AXIS_TOOL_MINOR,
- /** orientation */
- AINPUT_MOTION_RANGE_ORIENTATION = AMOTION_EVENT_AXIS_ORIENTATION,
- };
- #endif // _ANDROID_INPUT_H
|