src/video/uikit/keyinfotable.h
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Tue, 29 Jul 2008 17:23:50 +0000
branchgsoc2008_iphone
changeset 2407 6c31bbd56c49
child 2447 7683a2e0e5e9
permissions -rw-r--r--
keyinfotable.h contains information which SDL_uikitkeyboard uses to convert between unichar characters that it reads from the text field (which acts as the keyboard's target) to SDL_scancodes and key modifiers which are sent to SDL's keyboard system.
hfutrell@2407
     1
/*
hfutrell@2407
     2
 *  scancodes_iphoneos.h
hfutrell@2407
     3
 *  SDLiPhoneOS
hfutrell@2407
     4
 *
hfutrell@2407
     5
 *  Created by Holmes Futrell on 7/25/08.
hfutrell@2407
     6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
hfutrell@2407
     7
 *
hfutrell@2407
     8
 */
hfutrell@2407
     9
hfutrell@2407
    10
#ifndef _UIKIT_KeyInfo
hfutrell@2407
    11
#define _UIKIT_KeyInfo
hfutrell@2407
    12
hfutrell@2407
    13
#include "SDL_scancode.h"
hfutrell@2407
    14
hfutrell@2407
    15
typedef struct {
hfutrell@2407
    16
	SDL_scancode code;
hfutrell@2407
    17
	Uint16 mod;
hfutrell@2407
    18
} UIKitKeyInfo;
hfutrell@2407
    19
hfutrell@2407
    20
/* So far only ASCII characters here */
hfutrell@2407
    21
static UIKitKeyInfo unicharToUIKeyInfoTable[] = {
hfutrell@2407
    22
hfutrell@2407
    23
/*  0 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    24
/*  1 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    25
/*  2 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    26
/*  3 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    27
/*  4 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    28
/*  5 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    29
/*  6 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    30
/*  7 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    31
/*  8 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    32
/*  9 */  {  SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    33
/*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    34
/*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    35
/*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    36
/*  13 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    37
/*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    38
/*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    39
/*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    40
/*  17 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    41
/*  18 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    42
/*  19 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    43
/*  20 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    44
/*  21 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    45
/*  22 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    46
/*  23 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    47
/*  24 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    48
/*  25 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    49
/*  26 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    50
/*  27 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    51
/*  28 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    52
/*  29 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    53
/*  30 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    54
/*  31 */ {   SDL_SCANCODE_UNKNOWN, 0 },
hfutrell@2407
    55
/*  32 */ {   SDL_SCANCODE_SPACE, 0 },
hfutrell@2407
    56
/*  33 */ {   SDL_SCANCODE_1,	KMOD_SHIFT },		/* plus shift modifier '!' */
hfutrell@2407
    57
/*  34 */ {   SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT },	/* plus shift modifier '"' */
hfutrell@2407
    58
/*  35 */ {   SDL_SCANCODE_3, KMOD_SHIFT },			/* plus shift modifier '#' */
hfutrell@2407
    59
/*  36 */ {   SDL_SCANCODE_4, KMOD_SHIFT },			/* plus shift modifier '$' */
hfutrell@2407
    60
/*  37 */ {   SDL_SCANCODE_5, KMOD_SHIFT },			/* plus shift modifier '%' */
hfutrell@2407
    61
/*  38 */ {   SDL_SCANCODE_7, KMOD_SHIFT },			/* plus shift modifier '&' */
hfutrell@2407
    62
/*  39 */ {   SDL_SCANCODE_APOSTROPHE, 0 },	/* '''					   */
hfutrell@2407
    63
/*  40 */ {   SDL_SCANCODE_9, KMOD_SHIFT },	 		/* plus shift modifier '(' */
hfutrell@2407
    64
/*  41 */ {   SDL_SCANCODE_0, KMOD_SHIFT },			/* plus shift modifier ')' */
hfutrell@2407
    65
/*  42 */ {   SDL_SCANCODE_8, KMOD_SHIFT },			/* '*' */
hfutrell@2407
    66
/*  43 */ {   SDL_SCANCODE_EQUALS, KMOD_SHIFT },		/* plus shift modifier '+' */
hfutrell@2407
    67
/*  44 */ {   SDL_SCANCODE_COMMA, 0 },		/* ','					   */
hfutrell@2407
    68
/*  45 */ {   SDL_SCANCODE_MINUS, 0 },		/* '-'					   */
hfutrell@2407
    69
/*  46 */ {   SDL_SCANCODE_PERIOD, 0 },		/* '.'					   */
hfutrell@2407
    70
/*  47 */ {   SDL_SCANCODE_SLASH, 0 },		/* '/'					   */
hfutrell@2407
    71
/*  48 */ {   SDL_SCANCODE_0, 0	},		
hfutrell@2407
    72
/*  49 */ {   SDL_SCANCODE_1, 0 },
hfutrell@2407
    73
/*  50 */ {   SDL_SCANCODE_2, 0 },
hfutrell@2407
    74
/*  51 */ {   SDL_SCANCODE_3, 0 },
hfutrell@2407
    75
/*  52 */ {   SDL_SCANCODE_4, 0 },
hfutrell@2407
    76
/*  53 */ {   SDL_SCANCODE_5, 0 },
hfutrell@2407
    77
/*  54 */ {   SDL_SCANCODE_6, 0 },
hfutrell@2407
    78
/*  55 */ {   SDL_SCANCODE_7, 0 },
hfutrell@2407
    79
/*  56 */ {   SDL_SCANCODE_8, 0 },
hfutrell@2407
    80
/*  57 */ {   SDL_SCANCODE_9, 0 },
hfutrell@2407
    81
/*  58 */ {   SDL_SCANCODE_SEMICOLON,  KMOD_SHIFT },	/* plus shift modifier ';' */
hfutrell@2407
    82
/*  59 */ {   SDL_SCANCODE_SEMICOLON, 0 },
hfutrell@2407
    83
/*  60 */ {   SDL_SCANCODE_COMMA,  KMOD_SHIFT },	 	/* plus shift modifier '<' */
hfutrell@2407
    84
/*  61 */ {   SDL_SCANCODE_EQUALS, 0 },
hfutrell@2407
    85
/*  62 */ {   SDL_SCANCODE_PERIOD,  KMOD_SHIFT },		/* plus shift modifier '>' */
hfutrell@2407
    86
/*  63 */ {   SDL_SCANCODE_SLASH,  KMOD_SHIFT },		/* plus shift modifier '?' */
hfutrell@2407
    87
/*  64 */ {   SDL_SCANCODE_2,  KMOD_SHIFT },			/* plus shift modifier '@' */
hfutrell@2407
    88
/*  65 */ {   SDL_SCANCODE_A,  KMOD_SHIFT },			/* all the following need shift modifiers */
hfutrell@2407
    89
/*  66 */ {   SDL_SCANCODE_B,  KMOD_SHIFT },
hfutrell@2407
    90
/*  67 */ {   SDL_SCANCODE_C,  KMOD_SHIFT },
hfutrell@2407
    91
/*  68 */ {   SDL_SCANCODE_D,  KMOD_SHIFT },
hfutrell@2407
    92
/*  69 */ {   SDL_SCANCODE_E,  KMOD_SHIFT },
hfutrell@2407
    93
/*  70 */ {   SDL_SCANCODE_F,  KMOD_SHIFT },
hfutrell@2407
    94
/*  71 */ {   SDL_SCANCODE_G,  KMOD_SHIFT },
hfutrell@2407
    95
/*  72 */ {   SDL_SCANCODE_H,  KMOD_SHIFT },
hfutrell@2407
    96
/*  73 */ {   SDL_SCANCODE_I,  KMOD_SHIFT },
hfutrell@2407
    97
/*  74 */ {   SDL_SCANCODE_J,  KMOD_SHIFT },
hfutrell@2407
    98
/*  75 */ {   SDL_SCANCODE_K,  KMOD_SHIFT },
hfutrell@2407
    99
/*  76 */ {   SDL_SCANCODE_L,  KMOD_SHIFT },
hfutrell@2407
   100
/*  77 */ {   SDL_SCANCODE_M,  KMOD_SHIFT },
hfutrell@2407
   101
/*  78 */ {   SDL_SCANCODE_N,  KMOD_SHIFT },
hfutrell@2407
   102
/*  79 */ {   SDL_SCANCODE_O,  KMOD_SHIFT },
hfutrell@2407
   103
/*  80 */ {   SDL_SCANCODE_P,  KMOD_SHIFT },
hfutrell@2407
   104
/*  81 */ {   SDL_SCANCODE_Q,  KMOD_SHIFT },
hfutrell@2407
   105
/*  82 */ {   SDL_SCANCODE_R,  KMOD_SHIFT },
hfutrell@2407
   106
/*  83 */ {   SDL_SCANCODE_S,  KMOD_SHIFT },
hfutrell@2407
   107
/*  84 */ {	 SDL_SCANCODE_T,  KMOD_SHIFT },
hfutrell@2407
   108
/*  85 */ {   SDL_SCANCODE_U,  KMOD_SHIFT },
hfutrell@2407
   109
/*  86 */ {   SDL_SCANCODE_V,  KMOD_SHIFT },
hfutrell@2407
   110
/*  87 */ {   SDL_SCANCODE_W,  KMOD_SHIFT },
hfutrell@2407
   111
/*  88 */ {   SDL_SCANCODE_X,  KMOD_SHIFT },
hfutrell@2407
   112
/*  89 */ {   SDL_SCANCODE_Y,  KMOD_SHIFT },
hfutrell@2407
   113
/*  90 */ {  SDL_SCANCODE_Z,  KMOD_SHIFT },
hfutrell@2407
   114
/*  91 */ {   SDL_SCANCODE_LEFTBRACKET, 0 },
hfutrell@2407
   115
/*  92 */ {   SDL_SCANCODE_BACKSLASH, 0 },
hfutrell@2407
   116
/*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
hfutrell@2407
   117
/*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },				/* plus shift modifier '^' */
hfutrell@2407
   118
/*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },			/* plus shift modifier '_' */
hfutrell@2407
   119
/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },			/* '`'
hfutrell@2407
   120
/*  97 */ {   SDL_SCANCODE_A, 0	},	
hfutrell@2407
   121
/*  98 */ {   SDL_SCANCODE_B, 0 },
hfutrell@2407
   122
/*  99 */ {   SDL_SCANCODE_C, 0 },
hfutrell@2407
   123
/*  100 */{    SDL_SCANCODE_D, 0 },
hfutrell@2407
   124
/*  101 */{    SDL_SCANCODE_E, 0 },
hfutrell@2407
   125
/*  102 */{    SDL_SCANCODE_F, 0 },
hfutrell@2407
   126
/*  103 */{    SDL_SCANCODE_G, 0 },
hfutrell@2407
   127
/*  104 */{    SDL_SCANCODE_H, 0 },
hfutrell@2407
   128
/*  105 */{    SDL_SCANCODE_I, 0 },
hfutrell@2407
   129
/*  106 */{    SDL_SCANCODE_J, 0 },
hfutrell@2407
   130
/*  107 */{    SDL_SCANCODE_K, 0 },
hfutrell@2407
   131
/*  108 */{    SDL_SCANCODE_L, 0 },
hfutrell@2407
   132
/*  109 */{    SDL_SCANCODE_M, 0 },
hfutrell@2407
   133
/*  110 */{    SDL_SCANCODE_N, 0 },
hfutrell@2407
   134
/*  111 */{    SDL_SCANCODE_O, 0 },
hfutrell@2407
   135
/*  112 */{    SDL_SCANCODE_P, 0 },
hfutrell@2407
   136
/*  113 */{    SDL_SCANCODE_Q, 0 },
hfutrell@2407
   137
/*  114 */{    SDL_SCANCODE_R, 0 },
hfutrell@2407
   138
/*  115 */{    SDL_SCANCODE_S, 0 },
hfutrell@2407
   139
/*  116 */{    SDL_SCANCODE_T, 0 },
hfutrell@2407
   140
/*  117 */{    SDL_SCANCODE_U, 0 },
hfutrell@2407
   141
/*  118 */{    SDL_SCANCODE_V, 0 },
hfutrell@2407
   142
/*  119 */{    SDL_SCANCODE_W, 0 },
hfutrell@2407
   143
/*  120 */{	  SDL_SCANCODE_X, 0 },
hfutrell@2407
   144
/*  121 */{    SDL_SCANCODE_Y, 0 },
hfutrell@2407
   145
/*  122 */{    SDL_SCANCODE_Z, 0 },
hfutrell@2407
   146
/*  123 */{    SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT },		/* plus shift modifier '{' */
hfutrell@2407
   147
/*  124 */{    SDL_SCANCODE_BACKSLASH, KMOD_SHIFT },		/* plus shift modifier '|' */
hfutrell@2407
   148
/*  125 */{    SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT },	/* plus shift modifier '}' */
hfutrell@2407
   149
/*  126 */{    SDL_SCANCODE_GRAVE, KMOD_SHIFT },		 	/* plus shift modifier '~' */
hfutrell@2407
   150
/*  127 */{    SDL_SCANCODE_DELETE, KMOD_SHIFT }
hfutrell@2407
   151
};
hfutrell@2407
   152
hfutrell@2407
   153
#endif /* UIKitKeyInfo */