src/video/uikit/keyinfotable.h
author Kees Bakker <kees@ijzerbout.nl>
Tue, 27 Sep 2011 21:07:09 +0200
changeset 6002 0c0aaaa1e5ed
parent 6001 3ae3d1e58d59
child 6138 4c64952a58fb
permissions -rw-r--r--
Remove INDENT-ON INDENT-OFF comments in src/video/uikit

These comments are only useful for running indent which we are
probably not going to use in Objective-C context.
slouken@2765
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@5535
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
slouken@2765
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@2765
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@2765
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@2765
    20
*/
slouken@2765
    21
slouken@2765
    22
#ifndef _UIKIT_KeyInfo
slouken@2765
    23
#define _UIKIT_KeyInfo
slouken@2765
    24
slouken@2765
    25
#include "SDL_scancode.h"
slouken@2765
    26
slouken@2765
    27
/*
slouken@5133
    28
    This file is used by the keyboard code in SDL_uikitview.m to convert between characters
slouken@5218
    29
    passed in from the iPhone's virtual keyboard, and tuples of SDL_Scancode and SDL_keymods.
slouken@5133
    30
    For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower
slouken@5133
    31
    case a.
slouken@2765
    32
*/
slouken@2765
    33
slouken@2765
    34
typedef struct
slouken@2765
    35
{
slouken@5218
    36
    SDL_Scancode code;
slouken@2765
    37
    Uint16 mod;
slouken@2765
    38
} UIKitKeyInfo;
slouken@2765
    39
slouken@2765
    40
/* So far only ASCII characters here */
slouken@2765
    41
static UIKitKeyInfo unicharToUIKeyInfoTable[] = {
slouken@2765
    42
/*  0 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    43
/*  1 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    44
/*  2 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    45
/*  3 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    46
/*  4 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    47
/*  5 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    48
/*  6 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    49
/*  7 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    50
/*  8 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    51
/*  9 */  {  SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    52
/*  10 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    53
/*  11 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    54
/*  12 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@5134
    55
/*  13 */ {   SDL_SCANCODE_RETURN, 0 },
slouken@2765
    56
/*  14 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    57
/*  15 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    58
/*  16 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    59
/*  17 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    60
/*  18 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    61
/*  19 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    62
/*  20 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    63
/*  21 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    64
/*  22 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    65
/*  23 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    66
/*  24 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    67
/*  25 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    68
/*  26 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    69
/*  27 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    70
/*  28 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    71
/*  29 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    72
/*  30 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    73
/*  31 */ {   SDL_SCANCODE_UNKNOWN, 0 },
slouken@2765
    74
/*  32 */ {   SDL_SCANCODE_SPACE, 0 },
slouken@5133
    75
/*  33 */ {   SDL_SCANCODE_1,    KMOD_SHIFT },        /* plus shift modifier '!' */
slouken@5133
    76
/*  34 */ {   SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT },    /* plus shift modifier '"' */
slouken@5133
    77
/*  35 */ {   SDL_SCANCODE_3, KMOD_SHIFT },            /* plus shift modifier '#' */
slouken@5133
    78
/*  36 */ {   SDL_SCANCODE_4, KMOD_SHIFT },            /* plus shift modifier '$' */
slouken@5133
    79
/*  37 */ {   SDL_SCANCODE_5, KMOD_SHIFT },            /* plus shift modifier '%' */
slouken@5133
    80
/*  38 */ {   SDL_SCANCODE_7, KMOD_SHIFT },            /* plus shift modifier '&' */
slouken@5133
    81
/*  39 */ {   SDL_SCANCODE_APOSTROPHE, 0 },    /* '''                       */
slouken@5133
    82
/*  40 */ {   SDL_SCANCODE_9, KMOD_SHIFT },             /* plus shift modifier '(' */
slouken@5133
    83
/*  41 */ {   SDL_SCANCODE_0, KMOD_SHIFT },            /* plus shift modifier ')' */
slouken@5133
    84
/*  42 */ {   SDL_SCANCODE_8, KMOD_SHIFT },            /* '*' */
slouken@5133
    85
/*  43 */ {   SDL_SCANCODE_EQUALS, KMOD_SHIFT },    /* plus shift modifier '+' */
slouken@5133
    86
/*  44 */ {   SDL_SCANCODE_COMMA, 0 },        /* ','                       */
slouken@5133
    87
/*  45 */ {   SDL_SCANCODE_MINUS, 0 },        /* '-'                       */
slouken@5133
    88
/*  46 */ {   SDL_SCANCODE_PERIOD, 0 },        /* '.'                       */
slouken@5133
    89
/*  47 */ {   SDL_SCANCODE_SLASH, 0 },        /* '/'                       */
kees@6001
    90
/*  48 */ {   SDL_SCANCODE_0, 0    },
slouken@2765
    91
/*  49 */ {   SDL_SCANCODE_1, 0 },
slouken@2765
    92
/*  50 */ {   SDL_SCANCODE_2, 0 },
slouken@2765
    93
/*  51 */ {   SDL_SCANCODE_3, 0 },
slouken@2765
    94
/*  52 */ {   SDL_SCANCODE_4, 0 },
slouken@2765
    95
/*  53 */ {   SDL_SCANCODE_5, 0 },
slouken@2765
    96
/*  54 */ {   SDL_SCANCODE_6, 0 },
slouken@2765
    97
/*  55 */ {   SDL_SCANCODE_7, 0 },
slouken@2765
    98
/*  56 */ {   SDL_SCANCODE_8, 0 },
slouken@2765
    99
/*  57 */ {   SDL_SCANCODE_9, 0 },
slouken@5133
   100
/*  58 */ {   SDL_SCANCODE_SEMICOLON,  KMOD_SHIFT },    /* plus shift modifier ';' */
slouken@2765
   101
/*  59 */ {   SDL_SCANCODE_SEMICOLON, 0 },
slouken@5133
   102
/*  60 */ {   SDL_SCANCODE_COMMA,  KMOD_SHIFT },         /* plus shift modifier '<' */
slouken@2765
   103
/*  61 */ {   SDL_SCANCODE_EQUALS, 0 },
slouken@5133
   104
/*  62 */ {   SDL_SCANCODE_PERIOD,  KMOD_SHIFT },        /* plus shift modifier '>' */
slouken@5133
   105
/*  63 */ {   SDL_SCANCODE_SLASH,  KMOD_SHIFT },        /* plus shift modifier '?' */
slouken@5133
   106
/*  64 */ {   SDL_SCANCODE_2,  KMOD_SHIFT },            /* plus shift modifier '@' */
slouken@5133
   107
/*  65 */ {   SDL_SCANCODE_A,  KMOD_SHIFT },            /* all the following need shift modifiers */
slouken@2765
   108
/*  66 */ {   SDL_SCANCODE_B,  KMOD_SHIFT },
slouken@2765
   109
/*  67 */ {   SDL_SCANCODE_C,  KMOD_SHIFT },
slouken@2765
   110
/*  68 */ {   SDL_SCANCODE_D,  KMOD_SHIFT },
slouken@2765
   111
/*  69 */ {   SDL_SCANCODE_E,  KMOD_SHIFT },
slouken@2765
   112
/*  70 */ {   SDL_SCANCODE_F,  KMOD_SHIFT },
slouken@2765
   113
/*  71 */ {   SDL_SCANCODE_G,  KMOD_SHIFT },
slouken@2765
   114
/*  72 */ {   SDL_SCANCODE_H,  KMOD_SHIFT },
slouken@2765
   115
/*  73 */ {   SDL_SCANCODE_I,  KMOD_SHIFT },
slouken@2765
   116
/*  74 */ {   SDL_SCANCODE_J,  KMOD_SHIFT },
slouken@2765
   117
/*  75 */ {   SDL_SCANCODE_K,  KMOD_SHIFT },
slouken@2765
   118
/*  76 */ {   SDL_SCANCODE_L,  KMOD_SHIFT },
slouken@2765
   119
/*  77 */ {   SDL_SCANCODE_M,  KMOD_SHIFT },
slouken@2765
   120
/*  78 */ {   SDL_SCANCODE_N,  KMOD_SHIFT },
slouken@2765
   121
/*  79 */ {   SDL_SCANCODE_O,  KMOD_SHIFT },
slouken@2765
   122
/*  80 */ {   SDL_SCANCODE_P,  KMOD_SHIFT },
slouken@2765
   123
/*  81 */ {   SDL_SCANCODE_Q,  KMOD_SHIFT },
slouken@2765
   124
/*  82 */ {   SDL_SCANCODE_R,  KMOD_SHIFT },
slouken@2765
   125
/*  83 */ {   SDL_SCANCODE_S,  KMOD_SHIFT },
slouken@2765
   126
/*  84 */ {   SDL_SCANCODE_T,  KMOD_SHIFT },
slouken@2765
   127
/*  85 */ {   SDL_SCANCODE_U,  KMOD_SHIFT },
slouken@2765
   128
/*  86 */ {   SDL_SCANCODE_V,  KMOD_SHIFT },
slouken@2765
   129
/*  87 */ {   SDL_SCANCODE_W,  KMOD_SHIFT },
slouken@2765
   130
/*  88 */ {   SDL_SCANCODE_X,  KMOD_SHIFT },
slouken@2765
   131
/*  89 */ {   SDL_SCANCODE_Y,  KMOD_SHIFT },
slouken@2765
   132
/*  90 */ {   SDL_SCANCODE_Z,  KMOD_SHIFT },
slouken@2765
   133
/*  91 */ {   SDL_SCANCODE_LEFTBRACKET, 0 },
slouken@2765
   134
/*  92 */ {   SDL_SCANCODE_BACKSLASH, 0 },
slouken@2765
   135
/*  93 */ {   SDL_SCANCODE_RIGHTBRACKET, 0 },
slouken@5133
   136
/*  94 */ {   SDL_SCANCODE_6,  KMOD_SHIFT },            /* plus shift modifier '^' */
slouken@5133
   137
/*  95 */ {   SDL_SCANCODE_MINUS,  KMOD_SHIFT },        /* plus shift modifier '_' */
slouken@5134
   138
/*  96 */ {   SDL_SCANCODE_GRAVE,  KMOD_SHIFT },        /* '`' */
kees@6001
   139
/*  97 */ {   SDL_SCANCODE_A, 0    },
slouken@2765
   140
/*  98 */ {   SDL_SCANCODE_B, 0 },
slouken@2765
   141
/*  99 */ {   SDL_SCANCODE_C, 0 },
slouken@2765
   142
/*  100 */{    SDL_SCANCODE_D, 0 },
slouken@2765
   143
/*  101 */{    SDL_SCANCODE_E, 0 },
slouken@2765
   144
/*  102 */{    SDL_SCANCODE_F, 0 },
slouken@2765
   145
/*  103 */{    SDL_SCANCODE_G, 0 },
slouken@2765
   146
/*  104 */{    SDL_SCANCODE_H, 0 },
slouken@2765
   147
/*  105 */{    SDL_SCANCODE_I, 0 },
slouken@2765
   148
/*  106 */{    SDL_SCANCODE_J, 0 },
slouken@2765
   149
/*  107 */{    SDL_SCANCODE_K, 0 },
slouken@2765
   150
/*  108 */{    SDL_SCANCODE_L, 0 },
slouken@2765
   151
/*  109 */{    SDL_SCANCODE_M, 0 },
slouken@2765
   152
/*  110 */{    SDL_SCANCODE_N, 0 },
slouken@2765
   153
/*  111 */{    SDL_SCANCODE_O, 0 },
slouken@2765
   154
/*  112 */{    SDL_SCANCODE_P, 0 },
slouken@2765
   155
/*  113 */{    SDL_SCANCODE_Q, 0 },
slouken@2765
   156
/*  114 */{    SDL_SCANCODE_R, 0 },
slouken@2765
   157
/*  115 */{    SDL_SCANCODE_S, 0 },
slouken@2765
   158
/*  116 */{    SDL_SCANCODE_T, 0 },
slouken@2765
   159
/*  117 */{    SDL_SCANCODE_U, 0 },
slouken@2765
   160
/*  118 */{    SDL_SCANCODE_V, 0 },
slouken@2765
   161
/*  119 */{    SDL_SCANCODE_W, 0 },
slouken@2765
   162
/*  120 */{    SDL_SCANCODE_X, 0 },
slouken@2765
   163
/*  121 */{    SDL_SCANCODE_Y, 0 },
slouken@2765
   164
/*  122 */{    SDL_SCANCODE_Z, 0 },
slouken@5133
   165
/*  123 */{    SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT },    /* plus shift modifier '{' */
slouken@5133
   166
/*  124 */{    SDL_SCANCODE_BACKSLASH, KMOD_SHIFT },    /* plus shift modifier '|' */
slouken@5133
   167
/*  125 */{    SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT },    /* plus shift modifier '}' */
slouken@5133
   168
/*  126 */{    SDL_SCANCODE_GRAVE, KMOD_SHIFT },         /* plus shift modifier '~' */
slouken@2765
   169
/*  127 */{    SDL_SCANCODE_DELETE, KMOD_SHIFT }
slouken@2765
   170
};
slouken@2765
   171
slouken@2765
   172
#endif /* UIKitKeyInfo */
slouken@5133
   173
slouken@5133
   174
/* vi: set ts=4 sw=4 expandtab: */