charmap.h revision abe0822e3cccae6098c56f4fecb029f300b9a01a
1/* Copyright (C) 2007-2008 The Android Open Source Project 2** 3** This software is licensed under the terms of the GNU General Public 4** License version 2, as published by the Free Software Foundation, and 5** may be copied, distributed, and modified under those terms. 6** 7** This program is distributed in the hope that it will be useful, 8** but WITHOUT ANY WARRANTY; without even the implied warranty of 9** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10** GNU General Public License for more details. 11*/ 12#ifndef _android_charmap_h 13#define _android_charmap_h 14 15#include "linux_keycodes.h" 16 17/* Keep it consistent with linux/input.h */ 18typedef enum { 19 kKeyCodeSoftLeft = KEY_SOFT1, 20 kKeyCodeSoftRight = KEY_SOFT2, 21 kKeyCodeHome = KEY_HOME, 22 kKeyCodeBack = KEY_BACK, 23 kKeyCodeCall = KEY_SEND, 24 kKeyCodeEndCall = KEY_END, 25 kKeyCode0 = KEY_0, 26 kKeyCode1 = KEY_1, 27 kKeyCode2 = KEY_2, 28 kKeyCode3 = KEY_3, 29 kKeyCode4 = KEY_4, 30 kKeyCode5 = KEY_5, 31 kKeyCode6 = KEY_6, 32 kKeyCode7 = KEY_7, 33 kKeyCode8 = KEY_8, 34 kKeyCode9 = KEY_9, 35 kKeyCodeStar = KEY_STAR, 36 kKeyCodePound = KEY_SHARP, 37 kKeyCodeDpadUp = KEY_UP, 38 kKeyCodeDpadDown = KEY_DOWN, 39 kKeyCodeDpadLeft = KEY_LEFT, 40 kKeyCodeDpadRight = KEY_RIGHT, 41 kKeyCodeDpadCenter = KEY_CENTER, 42 kKeyCodeVolumeUp = KEY_VOLUMEUP, 43 kKeyCodeVolumeDown = KEY_VOLUMEDOWN, 44 kKeyCodePower = KEY_POWER, 45 kKeyCodeCamera = KEY_CAMERA, 46 kKeyCodeClear = KEY_CLEAR, 47 kKeyCodeA = KEY_A, 48 kKeyCodeB = KEY_B, 49 kKeyCodeC = KEY_C, 50 kKeyCodeD = KEY_D, 51 kKeyCodeE = KEY_E, 52 kKeyCodeF = KEY_F, 53 kKeyCodeG = KEY_G, 54 kKeyCodeH = KEY_H, 55 kKeyCodeI = KEY_I, 56 kKeyCodeJ = KEY_J, 57 kKeyCodeK = KEY_K, 58 kKeyCodeL = KEY_L, 59 kKeyCodeM = KEY_M, 60 kKeyCodeN = KEY_N, 61 kKeyCodeO = KEY_O, 62 kKeyCodeP = KEY_P, 63 kKeyCodeQ = KEY_Q, 64 kKeyCodeR = KEY_R, 65 kKeyCodeS = KEY_S, 66 kKeyCodeT = KEY_T, 67 kKeyCodeU = KEY_U, 68 kKeyCodeV = KEY_V, 69 kKeyCodeW = KEY_W, 70 kKeyCodeX = KEY_X, 71 kKeyCodeY = KEY_Y, 72 kKeyCodeZ = KEY_Z, 73 74 kKeyCodeComma = KEY_COMMA, 75 kKeyCodePeriod = KEY_DOT, 76 kKeyCodeAltLeft = KEY_LEFTALT, 77 kKeyCodeAltRight = KEY_RIGHTALT, 78 kKeyCodeCapLeft = KEY_LEFTSHIFT, 79 kKeyCodeCapRight = KEY_RIGHTSHIFT, 80 kKeyCodeTab = KEY_TAB, 81 kKeyCodeSpace = KEY_SPACE, 82 kKeyCodeSym = KEY_COMPOSE, 83 kKeyCodeExplorer = KEY_WWW, 84 kKeyCodeEnvelope = KEY_MAIL, 85 kKeyCodeNewline = KEY_ENTER, 86 kKeyCodeDel = KEY_BACKSPACE, 87 kKeyCodeGrave = 399, 88 kKeyCodeMinus = KEY_MINUS, 89 kKeyCodeEquals = KEY_EQUAL, 90 kKeyCodeLeftBracket = KEY_LEFTBRACE, 91 kKeyCodeRightBracket = KEY_RIGHTBRACE, 92 kKeyCodeBackslash = KEY_BACKSLASH, 93 kKeyCodeSemicolon = KEY_SEMICOLON, 94 kKeyCodeApostrophe = KEY_APOSTROPHE, 95 kKeyCodeSlash = KEY_SLASH, 96 kKeyCodeAt = KEY_EMAIL, 97 kKeyCodeNum = KEY_NUM, 98 kKeyCodeHeadsetHook = KEY_HEADSETHOOK, 99 kKeyCodeFocus = KEY_FOCUS, 100 kKeyCodePlus = KEY_PLUS, 101 kKeyCodeMenu = KEY_SOFT1, 102 kKeyCodeNotification = KEY_NOTIFICATION, 103 kKeyCodeSearch = KEY_SEARCH, 104 105} AndroidKeyCode; 106 107 108/* this defines a structure used to describe an Android keyboard charmap */ 109typedef struct AKeyEntry { 110 unsigned short code; 111 unsigned short base; 112 unsigned short caps; 113 unsigned short fn; 114 unsigned short caps_fn; 115 unsigned short number; 116} AKeyEntry; 117 118typedef struct { 119 const AKeyEntry* entries; 120 int num_entries; 121 char name[ 32 ]; 122} AKeyCharmap; 123 124extern const int android_charmap_count; 125extern const AKeyCharmap* android_charmaps[]; 126 127#endif /* _android_charmap_h */ 128