Home | History | Annotate | Download | only in view
      1 /*
      2  * Copyright (C) 2008 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.view;
     18 
     19 /**
     20  * @hide
     21  * This really belongs in services.jar; WindowManagerPolicy should go there too.
     22  */
     23 public class RawInputEvent {
     24     // Event class as defined by EventHub.
     25     public static final int CLASS_KEYBOARD = 0x00000001;
     26     public static final int CLASS_ALPHAKEY = 0x00000002;
     27     public static final int CLASS_TOUCHSCREEN = 0x00000004;
     28     public static final int CLASS_TRACKBALL = 0x00000008;
     29     public static final int CLASS_TOUCHSCREEN_MT = 0x00000010;
     30     public static final int CLASS_DPAD = 0x00000020;
     31 
     32     // More special classes for QueuedEvent below.
     33     public static final int CLASS_CONFIGURATION_CHANGED = 0x10000000;
     34 
     35     // Event types.
     36 
     37     public static final int EV_SYN = 0x00;
     38     public static final int EV_KEY = 0x01;
     39     public static final int EV_REL = 0x02;
     40     public static final int EV_ABS = 0x03;
     41     public static final int EV_MSC = 0x04;
     42     public static final int EV_SW = 0x05;
     43     public static final int EV_LED = 0x11;
     44     public static final int EV_SND = 0x12;
     45     public static final int EV_REP = 0x14;
     46     public static final int EV_FF = 0x15;
     47     public static final int EV_PWR = 0x16;
     48     public static final int EV_FF_STATUS = 0x17;
     49 
     50     // Platform-specific event types.
     51 
     52     public static final int EV_DEVICE_ADDED = 0x10000000;
     53     public static final int EV_DEVICE_REMOVED = 0x20000000;
     54 
     55     // Special key (EV_KEY) scan codes for pointer buttons.
     56 
     57     public static final int BTN_FIRST = 0x100;
     58 
     59     public static final int BTN_MISC = 0x100;
     60     public static final int BTN_0 = 0x100;
     61     public static final int BTN_1 = 0x101;
     62     public static final int BTN_2 = 0x102;
     63     public static final int BTN_3 = 0x103;
     64     public static final int BTN_4 = 0x104;
     65     public static final int BTN_5 = 0x105;
     66     public static final int BTN_6 = 0x106;
     67     public static final int BTN_7 = 0x107;
     68     public static final int BTN_8 = 0x108;
     69     public static final int BTN_9 = 0x109;
     70 
     71     public static final int BTN_MOUSE = 0x110;
     72     public static final int BTN_LEFT = 0x110;
     73     public static final int BTN_RIGHT = 0x111;
     74     public static final int BTN_MIDDLE = 0x112;
     75     public static final int BTN_SIDE = 0x113;
     76     public static final int BTN_EXTRA = 0x114;
     77     public static final int BTN_FORWARD = 0x115;
     78     public static final int BTN_BACK = 0x116;
     79     public static final int BTN_TASK = 0x117;
     80 
     81     public static final int BTN_JOYSTICK = 0x120;
     82     public static final int BTN_TRIGGER = 0x120;
     83     public static final int BTN_THUMB = 0x121;
     84     public static final int BTN_THUMB2 = 0x122;
     85     public static final int BTN_TOP = 0x123;
     86     public static final int BTN_TOP2 = 0x124;
     87     public static final int BTN_PINKIE = 0x125;
     88     public static final int BTN_BASE = 0x126;
     89     public static final int BTN_BASE2 = 0x127;
     90     public static final int BTN_BASE3 = 0x128;
     91     public static final int BTN_BASE4 = 0x129;
     92     public static final int BTN_BASE5 = 0x12a;
     93     public static final int BTN_BASE6 = 0x12b;
     94     public static final int BTN_DEAD = 0x12f;
     95 
     96     public static final int BTN_GAMEPAD = 0x130;
     97     public static final int BTN_A = 0x130;
     98     public static final int BTN_B = 0x131;
     99     public static final int BTN_C = 0x132;
    100     public static final int BTN_X = 0x133;
    101     public static final int BTN_Y = 0x134;
    102     public static final int BTN_Z = 0x135;
    103     public static final int BTN_TL = 0x136;
    104     public static final int BTN_TR = 0x137;
    105     public static final int BTN_TL2 = 0x138;
    106     public static final int BTN_TR2 = 0x139;
    107     public static final int BTN_SELECT = 0x13a;
    108     public static final int BTN_START = 0x13b;
    109     public static final int BTN_MODE = 0x13c;
    110     public static final int BTN_THUMBL = 0x13d;
    111     public static final int BTN_THUMBR = 0x13e;
    112 
    113     public static final int BTN_DIGI = 0x140;
    114     public static final int BTN_TOOL_PEN = 0x140;
    115     public static final int BTN_TOOL_RUBBER = 0x141;
    116     public static final int BTN_TOOL_BRUSH = 0x142;
    117     public static final int BTN_TOOL_PENCIL = 0x143;
    118     public static final int BTN_TOOL_AIRBRUSH = 0x144;
    119     public static final int BTN_TOOL_FINGER = 0x145;
    120     public static final int BTN_TOOL_MOUSE = 0x146;
    121     public static final int BTN_TOOL_LENS = 0x147;
    122     public static final int BTN_TOUCH = 0x14a;
    123     public static final int BTN_STYLUS = 0x14b;
    124     public static final int BTN_STYLUS2 = 0x14c;
    125     public static final int BTN_TOOL_DOUBLETAP = 0x14d;
    126     public static final int BTN_TOOL_TRIPLETAP = 0x14e;
    127 
    128     public static final int BTN_WHEEL = 0x150;
    129     public static final int BTN_GEAR_DOWN = 0x150;
    130     public static final int BTN_GEAR_UP = 0x151;
    131 
    132     public static final int BTN_LAST = 0x15f;
    133 
    134     // Relative axes (EV_REL) scan codes.
    135 
    136     public static final int REL_X = 0x00;
    137     public static final int REL_Y = 0x01;
    138     public static final int REL_Z = 0x02;
    139     public static final int REL_RX = 0x03;
    140     public static final int REL_RY = 0x04;
    141     public static final int REL_RZ = 0x05;
    142     public static final int REL_HWHEEL = 0x06;
    143     public static final int REL_DIAL = 0x07;
    144     public static final int REL_WHEEL = 0x08;
    145     public static final int REL_MISC = 0x09;
    146     public static final int REL_MAX = 0x0f;
    147 
    148     // Absolute axes (EV_ABS) scan codes.
    149 
    150     public static final int ABS_X = 0x00;
    151     public static final int ABS_Y = 0x01;
    152     public static final int ABS_Z = 0x02;
    153     public static final int ABS_RX = 0x03;
    154     public static final int ABS_RY = 0x04;
    155     public static final int ABS_RZ = 0x05;
    156     public static final int ABS_THROTTLE = 0x06;
    157     public static final int ABS_RUDDER = 0x07;
    158     public static final int ABS_WHEEL = 0x08;
    159     public static final int ABS_GAS = 0x09;
    160     public static final int ABS_BRAKE = 0x0a;
    161     public static final int ABS_HAT0X = 0x10;
    162     public static final int ABS_HAT0Y = 0x11;
    163     public static final int ABS_HAT1X = 0x12;
    164     public static final int ABS_HAT1Y = 0x13;
    165     public static final int ABS_HAT2X = 0x14;
    166     public static final int ABS_HAT2Y = 0x15;
    167     public static final int ABS_HAT3X = 0x16;
    168     public static final int ABS_HAT3Y = 0x17;
    169     public static final int ABS_PRESSURE = 0x18;
    170     public static final int ABS_DISTANCE = 0x19;
    171     public static final int ABS_TILT_X = 0x1a;
    172     public static final int ABS_TILT_Y = 0x1b;
    173     public static final int ABS_TOOL_WIDTH = 0x1c;
    174     public static final int ABS_VOLUME = 0x20;
    175     public static final int ABS_MISC = 0x28;
    176     public static final int ABS_MT_TOUCH_MAJOR = 0x30;
    177     public static final int ABS_MT_TOUCH_MINOR = 0x31;
    178     public static final int ABS_MT_WIDTH_MAJOR = 0x32;
    179     public static final int ABS_MT_WIDTH_MINOR = 0x33;
    180     public static final int ABS_MT_ORIENTATION = 0x34;
    181     public static final int ABS_MT_POSITION_X = 0x35;
    182     public static final int ABS_MT_POSITION_Y = 0x36;
    183     public static final int ABS_MT_TOOL_TYPE = 0x37;
    184     public static final int ABS_MT_BLOB_ID = 0x38;
    185     public static final int ABS_MAX = 0x3f;
    186 
    187     // Switch events
    188     public static final int SW_LID = 0x00;
    189 
    190     public static final int SYN_REPORT = 0;
    191     public static final int SYN_CONFIG = 1;
    192     public static final int SYN_MT_REPORT = 2;
    193 
    194     public int deviceId;
    195     public int type;
    196     public int scancode;
    197     public int keycode;
    198     public int flags;
    199     public int value;
    200     public long when;
    201 }
    202