00001 /* clib/include/able/input.h 00002 * 00003 * ABLE Input event system. 00004 * 00005 * Copyright 2008 Simtec Electronics 00006 * 00007 * Permission is hereby granted, free of charge, to any person 00008 * obtaining a copy of this software and associated documentation 00009 * files (the "Software"), to deal in the Software without 00010 * restriction, including without limitation the rights to use, copy, 00011 * modify, merge, publish, distribute, sublicense, and/or sell copies 00012 * of the Software, and to permit persons to whom the Software is 00013 * furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be 00016 * included in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00021 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00022 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00023 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00024 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00025 * SOFTWARE. 00026 * 00027 */ 00028 00029 #ifndef _ABLE_CLIB_ABLE_INPUT_H 00030 #define _ABLE_CLIB_ABLE_INPUT_H 1 00031 00038 struct input_event { 00039 struct timeval time; 00040 uint16_t type; 00041 uint16_t code; 00042 int32_t value; 00045 }; 00046 00047 /* The type of an event. 00048 * 00049 * Input event types, these are defines instead of an enum so we match the 00050 * linux codes and names. 00051 */ 00052 #define EV_SYN 0x00 00053 #define EV_KEY 0x01 00054 #define EV_REL 0x02 00055 #define EV_ABS 0x03 00057 /* Code values for ::EV_KEY type. 00058 * 00059 * Again these line up with their linux equivalents in value and name. 00060 */ 00061 #define BTN_LEFT 0x110 00062 #define BTN_RIGHT 0x111 00063 #define BTN_MIDDLE 0x112 00064 #define BTN_SIDE 0x113 00065 #define BTN_EXTRA 0x114 00066 #define BTN_FORWARD 0x115 00067 #define BTN_BACK 0x116 00069 /* Code values for the ::EV_REL type. 00070 * 00071 * These code values define the axis for the relative event. The value contains 00072 * the magnitude. 00073 */ 00074 #define REL_X 0x00 00075 #define REL_Y 0x01 00076 #define REL_Z 0x02 00077 #define REL_RX 0x03 00078 #define REL_RY 0x04 00079 #define REL_RZ 0x05 00080 #define REL_HWHEEL 0x06 00081 #define REL_DIAL 0x07 00082 #define REL_WHEEL 0x08 00083 #define REL_MISC 0x09 00085 /* Code values for the ::EV_ABS type. 00086 * 00087 * These code values define the axis for the absolute event. The value contains 00088 * the magnitude. 00089 */ 00090 #define ABS_X 0x00 00091 #define ABS_Y 0x01 00092 #define ABS_Z 0x02 00094 #endif