src/video/uikit/keyinfotable.h
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Sat, 16 Aug 2008 00:10:15 +0000
branchgsoc2008_iphone
changeset 2447 7683a2e0e5e9
parent 2407 6c31bbd56c49
permissions -rw-r--r--
Added comments
hfutrell@2407
     1
/*
hfutrell@2447
     2
 SDL - Simple DirectMedia Layer
hfutrell@2447
     3
 Copyright (C) 1997-2006 Sam Lantinga
hfutrell@2447
     4
 
hfutrell@2447
     5
 This library is free software; you can redistribute it and/or
hfutrell@2447
     6
 modify it under the terms of the GNU Lesser General Public
hfutrell@2447
     7
 License as published by the Free Software Foundation; either
hfutrell@2447
     8
 version 2.1 of the License, or (at your option) any later version.
hfutrell@2447
     9
 
hfutrell@2447
    10
 This library is distributed in the hope that it will be useful,
hfutrell@2447
    11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
hfutrell@2447
    12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
hfutrell@2447
    13
 Lesser General Public License for more details.
hfutrell@2447
    14
 
hfutrell@2447
    15
 You should have received a copy of the GNU Lesser General Public
hfutrell@2447
    16
 License along with this library; if not, write to the Free Software
hfutrell@2447
    17
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
hfutrell@2447
    18
 
hfutrell@2447
    19
 Sam Lantinga
hfutrell@2447
    20
 slouken@libsdl.org
hfutrell@2407
    21
 */
hfutrell@2407
    22
hfutrell@2407
    23
#ifndef _UIKIT_KeyInfo
hfutrell@2407
    24
#define _UIKIT_KeyInfo
hfutrell@2407
    25
hfutrell@2407
    26
#include "SDL_scancode.h"
hfutrell@2407
    27
hfutrell@2447
    28
/*
hfutrell@2447
    29
	This file is used by the keyboard code in SDL_uikitview.m to convert between characters
hfutrell@2447
    30
	passed in from the iPhone's virtual keyboard, and tuples of SDL_scancodes and SDL_keymods.
hfutrell@2447
    31
	For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower
hfutrell@2447
    32
	case a.
hfutrell@2447
    33
*/
hfutrell@2447
    34
hfutrell@2407
    35
typedef struct {
hfutrell@2407
    36
	SDL_scancode code;
hfutrell@2407
    37
	Uint16 mod;
hfutrell@2407
    38
} UIKitKeyInfo;
hfutrell@2407
    39
hfutrell@2407
    40
/* So far only ASCII characters here */
hfutrell@2407
    41
static UIKitKeyInfo unicharToUIKeyInfoTable[] = {
hfutrell@2407
    42
hfutrell@2407
    43
/*  0 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    44
/*  1 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    45
/*  2 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    46
/*  3 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    47
/*  4 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    48
/*  5 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    49
/*  6 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    50
/*  7 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    51
/*  8 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    52
/*  9 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    53
/*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    54
/*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    55
/*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    56
/*  13 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    57
/*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    58
/*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    59
/*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    60
/*  17 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    61
/*  18 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    62
/*  19 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    63
/*  20 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    64
/*  21 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    65
/*  22 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    66
/*  23 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    67
/*  24 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    68
/*  25 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    69
/*  26 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    70
/*  27 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    71
/*  28 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    72
/*  29 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    73
/*  30 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    74
/*  31 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    75
/*  32 */ {   SDL_SCANCODE_SPACE, 0 },
hfutrell@2407
    76
/*  33 */ {   SDL_SCANCODE_1,	KMOD_SHIFT },		/* plus shift modifier '!' */
hfutrell@2407
    77
/*  34 */ {   SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT },	/* plus shift modifier '"' */
hfutrell@2407
    78
/*  35 */ {   SDL_SCANCODE_3, KMOD_SHIFT },			/* plus shift modifier '#' */
hfutrell@2407
    79
/*  36 */ {   SDL_SCANCODE_4, KMOD_SHIFT },			/* plus shift modifier '$' */
hfutrell@2407
    80
/*  37 */ {   SDL_SCANCODE_5, KMOD_SHIFT },			/* plus shift modifier '%' */
hfutrell@2407
    81
/*  38 */ {   SDL_SCANCODE_7, KMOD_SHIFT },			/* plus shift modifier '&' */
hfutrell@2407
    82
/*  39 */ {   SDL_SCANCODE_APOSTROPHE, 0 },	/* '''					   */
hfutrell@2407
    83
/*  40 */ {   SDL_SCANCODE_9, KMOD_SHIFT },	 		/* plus shift modifier '(' */
hfutrell@2407
    84
/*  41 */ {   SDL_SCANCODE_0, KMOD_SHIFT },			/* plus shift modifier ')' */
hfutrell@2407
    85
/*  42 */ {   SDL_SCANCODE_8, KMOD_SHIFT },			/* '*' */
hfutrell@2407
    86
/*  43 */ {   SDL_SCANCODE_EQUALS, KMOD_SHIFT },		/* plus shift modifier '+' */
hfutrell@2407
    87
/*  44 */ {   SDL_SCANCODE_COMMA, 0 },		/* ','					   */
hfutrell@2407
    88
/*  45 */ {   SDL_SCANCODE_MINUS, 0 },		/* '-'					   */
hfutrell@2407
    89
/*  46 */ {   SDL_SCANCODE_PERIOD, 0 },		/* '.'					   */
hfutrell@2407
    90
/*  47 */ {   SDL_SCANCODE_SLASH, 0 },		/* '/'					   */
hfutrell@2407
    91
/*  48 */ {   SDL_SCANCODE_0, 0	},		
hfutrell@2407
    92
/*  49 */ {   SDL_SCANCODE_1, 0 },
hfutrell@2407
    93
/*  50 */ {   SDL_SCANCODE_2, 0 },
hfutrell@2407
    94
/*  51 */ {   SDL_SCANCODE_3, 0 },
hfutrell@2407
    95
/*  52 */ {   SDL_SCANCODE_4, 0 },
hfutrell@2407
    96
/*  53 */ {   SDL_SCANCODE_5, 0 },
hfutrell@2407
    97
/*  54 */ {   SDL_SCANCODE_6, 0 },
hfutrell@2407
    98
/*  55 */ {   SDL_SCANCODE_7, 0 },
hfutrell@2407
    99
/*  56 */ {   SDL_SCANCODE_8, 0 },
hfutrell@2407
   100
/*  57 */ {   SDL_SCANCODE_9, 0 },
hfutrell@2407
   101
/*  58 */ {   SDL_SCANCODE_SEMICOLON,  KMOD_SHIFT },	/* plus shift modifier ';' */
hfutrell@2407
   102
/*  59 */ {   SDL_SCANCODE_SEMICOLON, 0 },
hfutrell@2407
   103
/*  60 */ {   SDL_SCANCODE_COMMA,  KMOD_SHIFT },	 	/* plus shift modifier '<' */
hfutrell@2407
   104
/*  61 */ {   SDL_SCANCODE_EQUALS, 0 },
hfutrell@2407
   105
/*  62 */ {   SDL_SCANCODE_PERIOD,  KMOD_SHIFT },		/* plus shift modifier '>' */
hfutrell@2407
   106
/*  63 */ {   SDL_SCANCODE_SLASH,  KMOD_SHIFT },		/* plus shift modifier '?' */
hfutrell@2407
   107
/*  64 */ {   SDL_SCANCODE_2,  KMOD_SHIFT },			/* plus shift modifier '@' */
hfutrell@2407
   108
/*  65 */ {   SDL_SCANCODE_A,  KMOD_SHIFT },			/* all the following need shift modifiers */
hfutrell@2407
   109
/*  66 */ {   SDL_SCANCODE_B,  KMOD_SHIFT },
hfutrell@2407
   110
/*  67 */ {   SDL_SCANCODE_C,  KMOD_SHIFT },
hfutrell@2407
   111
/*  68 */ {   SDL_SCANCODE_D,  KMOD_SHIFT },
hfutrell@2407
   112
/*  69 */ {   SDL_SCANCODE_E,  KMOD_SHIFT },
hfutrell@2407
   113
/*  70 */ {   SDL_SCANCODE_F,  KMOD_SHIFT },
hfutrell@2407
   114
/*  71 */ {   SDL_SCANCODE_G,  KMOD_SHIFT },
hfutrell@2407
   115
/*  72 */ {   SDL_SCANCODE_H,  KMOD_SHIFT },
hfutrell@2407
   116
/*  73 */ {   SDL_SCANCODE_I,  KMOD_SHIFT },
hfutrell@2407
   117
/*  74 */ {   SDL_SCANCODE_J,  KMOD_SHIFT },
hfutrell@2407
   118
/*  75 */ {   SDL_SCANCODE_K,  KMOD_SHIFT },
hfutrell@2407
   119
/*  76 */ {   SDL_SCANCODE_L,  KMOD_SHIFT },
hfutrell@2407
   120
/*  77 */ {   SDL_SCANCODE_M,  KMOD_SHIFT },
hfutrell@2407
   121
/*  78 */ {   SDL_SCANCODE_N,  KMOD_SHIFT },
hfutrell@2407
   122
/*  79 */ {   SDL_SCANCODE_O,  KMOD_SHIFT },
hfutrell@2407
   123
/*  80 */ {   SDL_SCANCODE_P,  KMOD_SHIFT },
hfutrell@2407
   124
/*  81 */ {   SDL_SCANCODE_Q,  KMOD_SHIFT },
hfutrell@2407
   125
/*  82 */ {   SDL_SCANCODE_R,  KMOD_SHIFT },
hfutrell@2407
   126
/*  83 */ {   SDL_SCANCODE_S,  KMOD_SHIFT },
hfutrell@2407
   127
/*  84 */ {	 SDL_SCANCODE_T,  KMOD_SHIFT },
hfutrell@2407
   128
/*  85 */ {   SDL_SCANCODE_U,  KMOD_SHIFT },
hfutrell@2407
   129
/*  86 */ {   SDL_SCANCODE_V,  KMOD_SHIFT },
hfutrell@2407
   130
/*  87 */ {   SDL_SCANCODE_W,  KMOD_SHIFT },
hfutrell@2407
   131
/*  88 */ {   SDL_SCANCODE_X,  KMOD_SHIFT },
hfutrell@2407
   132
/*  89 */ {   SDL_SCANCODE_Y,  KMOD_SHIFT },
hfutrell@2407
   133
/*  90 */ {  SDL_SCANCODE_Z,  KMOD_SHIFT },
hfutrell@2407
   134
/*  91 */ {   SDL_SCANCODE_LEFTBRACKET, 0 },
hfutrell@2407
   135
/*  92 */ {   SDL_SCANCODE_BACKSLASH, 0 },
hfutrell@2407
   136
/*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
hfutrell@2407
   137
/*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },				/* plus shift modifier '^' */
hfutrell@2407
   138
/*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },			/* plus shift modifier '_' */
hfutrell@2407
   139
/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },			/* '`'
hfutrell@2407
   140
/*  97 */ {   SDL_SCANCODE_A, 0	},	
hfutrell@2407
   141
/*  98 */ {   SDL_SCANCODE_B, 0 },
hfutrell@2407
   142
/*  99 */ {   SDL_SCANCODE_C, 0 },
hfutrell@2407
   143
/*  100 */{    SDL_SCANCODE_D, 0 },
hfutrell@2407
   144
/*  101 */{    SDL_SCANCODE_E, 0 },
hfutrell@2407
   145
/*  102 */{    SDL_SCANCODE_F, 0 },
hfutrell@2407
   146
/*  103 */{    SDL_SCANCODE_G, 0 },
hfutrell@2407
   147
/*  104 */{    SDL_SCANCODE_H, 0 },
hfutrell@2407
   148
/*  105 */{    SDL_SCANCODE_I, 0 },
hfutrell@2407
   149
/*  106 */{    SDL_SCANCODE_J, 0 },
hfutrell@2407
   150
/*  107 */{    SDL_SCANCODE_K, 0 },
hfutrell@2407
   151
/*  108 */{    SDL_SCANCODE_L, 0 },
hfutrell@2407
   152
/*  109 */{    SDL_SCANCODE_M, 0 },
hfutrell@2407
   153
/*  110 */{    SDL_SCANCODE_N, 0 },
hfutrell@2407
   154
/*  111 */{    SDL_SCANCODE_O, 0 },
hfutrell@2407
   155
/*  112 */{    SDL_SCANCODE_P, 0 },
hfutrell@2407
   156
/*  113 */{    SDL_SCANCODE_Q, 0 },
hfutrell@2407
   157
/*  114 */{    SDL_SCANCODE_R, 0 },
hfutrell@2407
   158
/*  115 */{    SDL_SCANCODE_S, 0 },
hfutrell@2407
   159
/*  116 */{    SDL_SCANCODE_T, 0 },
hfutrell@2407
   160
/*  117 */{    SDL_SCANCODE_U, 0 },
hfutrell@2407
   161
/*  118 */{    SDL_SCANCODE_V, 0 },
hfutrell@2407
   162
/*  119 */{    SDL_SCANCODE_W, 0 },
hfutrell@2407
   163
/*  120 */{	  SDL_SCANCODE_X, 0 },
hfutrell@2407
   164
/*  121 */{    SDL_SCANCODE_Y, 0 },
hfutrell@2407
   165
/*  122 */{    SDL_SCANCODE_Z, 0 },
hfutrell@2407
   166
/*  123 */{    SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT },		/* plus shift modifier '{' */
hfutrell@2407
   167
/*  124 */{    SDL_SCANCODE_BACKSLASH, KMOD_SHIFT },		/* plus shift modifier '|' */
hfutrell@2407
   168
/*  125 */{    SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT },	/* plus shift modifier '}' */
hfutrell@2407
   169
/*  126 */{    SDL_SCANCODE_GRAVE, KMOD_SHIFT },		 	/* plus shift modifier '~' */
hfutrell@2407
   170
/*  127 */{    SDL_SCANCODE_DELETE, KMOD_SHIFT }
hfutrell@2407
   171
};
hfutrell@2407
   172
hfutrell@2407
   173
#endif /* UIKitKeyInfo */