src/video/android/SDL_androidkeyboard.c
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 15 May 2013 22:24:23 +0200
changeset 7177 8261f0946a2f
parent 7163 55eb3d3135eb
child 7191 75360622e65f
permissions -rw-r--r--
Corrected internal function prototype.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6811
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     7
  arising from the use of this software.
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    11
  freely, subject to the following restrictions:
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
#include "SDL_config.h"
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
6044
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
    23
#if SDL_VIDEO_DRIVER_ANDROID
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
    24
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    25
#include <android/log.h>
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    26
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
#include "../../events/SDL_events_c.h"
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
#include "SDL_androidkeyboard.h"
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
7163
55eb3d3135eb Fixed implicit function declaration warnings.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 6885
diff changeset
    31
#include "../../core/android/SDL_android.h"
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
7177
8261f0946a2f Corrected internal function prototype.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 7163
diff changeset
    33
void Android_InitKeyboard(void)
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
{
5220
1fbe1c202501 Renamed SDL_Key to SDL_Keycode to clarify terminology.
Sam Lantinga <slouken@libsdl.org>
parents: 5219
diff changeset
    35
    SDL_Keycode keymap[SDL_NUM_SCANCODES];
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
    /* Add default scancode to key mapping */
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
    SDL_GetDefaultKeymap(keymap);
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
    SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES);
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
}
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
    42
static SDL_Scancode Android_Keycodes[] = {
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    43
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    44
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_LEFT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    45
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_RIGHT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    46
    SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    47
    SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    48
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALL */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    49
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENDCALL */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    50
    SDL_SCANCODE_0, /* AKEYCODE_0 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    51
    SDL_SCANCODE_1, /* AKEYCODE_1 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    52
    SDL_SCANCODE_2, /* AKEYCODE_2 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    53
    SDL_SCANCODE_3, /* AKEYCODE_3 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    54
    SDL_SCANCODE_4, /* AKEYCODE_4 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    55
    SDL_SCANCODE_5, /* AKEYCODE_5 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    56
    SDL_SCANCODE_6, /* AKEYCODE_6 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    57
    SDL_SCANCODE_7, /* AKEYCODE_7 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    58
    SDL_SCANCODE_8, /* AKEYCODE_8 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    59
    SDL_SCANCODE_9, /* AKEYCODE_9 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    60
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    61
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    62
    SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    63
    SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    64
    SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    65
    SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    66
    SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    67
    SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    68
    SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    69
    SDL_SCANCODE_POWER, /* AKEYCODE_POWER */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    70
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    71
    SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    72
    SDL_SCANCODE_A, /* AKEYCODE_A */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    73
    SDL_SCANCODE_B, /* AKEYCODE_B */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    74
    SDL_SCANCODE_C, /* AKEYCODE_C */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    75
    SDL_SCANCODE_D, /* AKEYCODE_D */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    76
    SDL_SCANCODE_E, /* AKEYCODE_E */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    77
    SDL_SCANCODE_F, /* AKEYCODE_F */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    78
    SDL_SCANCODE_G, /* AKEYCODE_G */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    79
    SDL_SCANCODE_H, /* AKEYCODE_H */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    80
    SDL_SCANCODE_I, /* AKEYCODE_I */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    81
    SDL_SCANCODE_J, /* AKEYCODE_J */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    82
    SDL_SCANCODE_K, /* AKEYCODE_K */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    83
    SDL_SCANCODE_L, /* AKEYCODE_L */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    84
    SDL_SCANCODE_M, /* AKEYCODE_M */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    85
    SDL_SCANCODE_N, /* AKEYCODE_N */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    86
    SDL_SCANCODE_O, /* AKEYCODE_O */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    87
    SDL_SCANCODE_P, /* AKEYCODE_P */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    88
    SDL_SCANCODE_Q, /* AKEYCODE_Q */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    89
    SDL_SCANCODE_R, /* AKEYCODE_R */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    90
    SDL_SCANCODE_S, /* AKEYCODE_S */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    91
    SDL_SCANCODE_T, /* AKEYCODE_T */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    92
    SDL_SCANCODE_U, /* AKEYCODE_U */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    93
    SDL_SCANCODE_V, /* AKEYCODE_V */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    94
    SDL_SCANCODE_W, /* AKEYCODE_W */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    95
    SDL_SCANCODE_X, /* AKEYCODE_X */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    96
    SDL_SCANCODE_Y, /* AKEYCODE_Y */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    97
    SDL_SCANCODE_Z, /* AKEYCODE_Z */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    98
    SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
    99
    SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   100
    SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   101
    SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   102
    SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   103
    SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   104
    SDL_SCANCODE_TAB, /* AKEYCODE_TAB */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   105
    SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   106
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */
6465
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   107
    SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   108
    SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   109
    SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */
6465
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   110
    SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   111
    SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   112
    SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   113
    SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   114
    SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   115
    SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   116
    SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   117
    SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   118
    SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */
6465
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   119
    SDL_SCANCODE_SLASH, /* AKEYCODE_SLASH */
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   120
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   121
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   122
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   123
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   124
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   125
    SDL_SCANCODE_MENU, /* AKEYCODE_MENU */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   126
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   127
    SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   128
    SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   129
    SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   130
    SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   131
    SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   132
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_REWIND */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   133
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_FAST_FORWARD */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   134
    SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   135
    SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   136
    SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   137
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   138
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   139
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   140
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   141
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   142
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   143
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   144
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   145
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   146
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   147
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   148
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   149
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   150
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   151
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   152
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   153
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */
6465
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   154
    SDL_SCANCODE_ESCAPE, /* AKEYCODE_ESCAPE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   155
    SDL_SCANCODE_DELETE, /* AKEYCODE_FORWARD_DEL */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   156
    SDL_SCANCODE_LCTRL, /* AKEYCODE_CTRL_LEFT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   157
    SDL_SCANCODE_RCTRL, /* AKEYCODE_CTRL_RIGHT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   158
    SDL_SCANCODE_CAPSLOCK, /* AKEYCODE_CAPS_LOCK */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   159
    SDL_SCANCODE_SCROLLLOCK, /* AKEYCODE_SCROLL_LOCK */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   160
    SDL_SCANCODE_LGUI, /* AKEYCODE_META_LEFT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   161
    SDL_SCANCODE_RGUI, /* AKEYCODE_META_RIGHT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   162
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FUNCTION */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   163
    SDL_SCANCODE_PRINTSCREEN, /* AKEYCODE_SYSRQ */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   164
    SDL_SCANCODE_PAUSE, /* AKEYCODE_BREAK */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   165
    SDL_SCANCODE_HOME, /* AKEYCODE_MOVE_HOME */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   166
    SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   167
    SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   168
    SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   169
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   170
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   171
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   172
    SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   173
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   174
    SDL_SCANCODE_F1, /* AKEYCODE_F1 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   175
    SDL_SCANCODE_F2, /* AKEYCODE_F2 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   176
    SDL_SCANCODE_F3, /* AKEYCODE_F3 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   177
    SDL_SCANCODE_F4, /* AKEYCODE_F4 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   178
    SDL_SCANCODE_F5, /* AKEYCODE_F5 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   179
    SDL_SCANCODE_F6, /* AKEYCODE_F6 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   180
    SDL_SCANCODE_F7, /* AKEYCODE_F7 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   181
    SDL_SCANCODE_F8, /* AKEYCODE_F8 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   182
    SDL_SCANCODE_F9, /* AKEYCODE_F9 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   183
    SDL_SCANCODE_F10, /* AKEYCODE_F10 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   184
    SDL_SCANCODE_F11, /* AKEYCODE_F11 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   185
    SDL_SCANCODE_F12, /* AKEYCODE_F12 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   186
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   187
    SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   188
    SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   189
    SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   190
    SDL_SCANCODE_KP_3, /* AKEYCODE_NUMPAD_3 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   191
    SDL_SCANCODE_KP_4, /* AKEYCODE_NUMPAD_4 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   192
    SDL_SCANCODE_KP_5, /* AKEYCODE_NUMPAD_5 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   193
    SDL_SCANCODE_KP_6, /* AKEYCODE_NUMPAD_6 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   194
    SDL_SCANCODE_KP_7, /* AKEYCODE_NUMPAD_7 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   195
    SDL_SCANCODE_KP_8, /* AKEYCODE_NUMPAD_8 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   196
    SDL_SCANCODE_KP_9, /* AKEYCODE_NUMPAD_9 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   197
    SDL_SCANCODE_KP_DIVIDE, /* AKEYCODE_NUMPAD_DIVIDE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   198
    SDL_SCANCODE_KP_MULTIPLY, /* AKEYCODE_NUMPAD_MULTIPLY */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   199
    SDL_SCANCODE_KP_MINUS, /* AKEYCODE_NUMPAD_SUBTRACT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   200
    SDL_SCANCODE_KP_PLUS, /* AKEYCODE_NUMPAD_ADD */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   201
    SDL_SCANCODE_KP_PERIOD, /* AKEYCODE_NUMPAD_DOT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   202
    SDL_SCANCODE_KP_COMMA, /* AKEYCODE_NUMPAD_COMMA */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   203
    SDL_SCANCODE_KP_ENTER, /* AKEYCODE_NUMPAD_ENTER */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   204
    SDL_SCANCODE_KP_EQUALS, /* AKEYCODE_NUMPAD_EQUALS */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   205
    SDL_SCANCODE_KP_LEFTPAREN, /* AKEYCODE_NUMPAD_LEFT_PAREN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   206
    SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   207
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   208
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   209
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   210
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   211
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   212
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   213
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   214
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WINDOW */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   215
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_GUIDE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   216
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DVR */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   217
    SDL_SCANCODE_AC_BOOKMARKS, /* AKEYCODE_BOOKMARK */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   218
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAPTIONS */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   219
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SETTINGS */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   220
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_POWER */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   221
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   222
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_POWER */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   223
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_INPUT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   224
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_POWER */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   225
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_INPUT */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   226
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_RED */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   227
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_GREEN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   228
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_YELLOW */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   229
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_BLUE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   230
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_APP_SWITCH */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   231
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_1 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   232
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_2 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   233
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_3 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   234
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_4 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   235
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_5 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   236
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_6 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   237
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_7 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   238
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_8 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   239
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_9 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   240
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_10 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   241
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_11 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   242
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_12 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   243
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_13 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   244
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_14 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   245
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_15 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   246
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_16 */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   247
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LANGUAGE_SWITCH */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   248
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MANNER_MODE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   249
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_3D_MODE */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   250
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   251
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   252
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   253
    SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   254
    SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   255
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   256
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUHENKAN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   257
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HENKAN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   258
    SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   259
    SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   260
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   261
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */
09b96f7ebe80 Fixed bug 1559 - SDL does not provide scancodes for all keys available on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6392
diff changeset
   262
    SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   263
};
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   264
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
   265
static SDL_Scancode
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   266
TranslateKeycode(int keycode)
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   267
{
5218
572a73d71b5f Sheena pointed out that "scancode" and "keysym" are single words and shouldn't be camel-cased.
Sam Lantinga <slouken@libsdl.org>
parents: 5081
diff changeset
   268
    SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN;
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   269
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   270
    if (keycode < SDL_arraysize(Android_Keycodes)) {
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   271
        scancode = Android_Keycodes[keycode];
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   272
    }
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   273
    if (scancode == SDL_SCANCODE_UNKNOWN) {
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   274
        __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode);
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   275
    }
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   276
    return scancode;
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   277
}
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   278
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   279
int
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   280
Android_OnKeyDown(int keycode)
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   281
{
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   282
    return SDL_SendKeyboardKey(SDL_PRESSED, TranslateKeycode(keycode));
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   283
}
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   284
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   285
int
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   286
Android_OnKeyUp(int keycode)
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   287
{
4993
3c9058f3ffe7 Implemented translation from Android keycodes to SDL scancodes
Sam Lantinga <slouken@libsdl.org>
parents: 4980
diff changeset
   288
    return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode));
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   289
}
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   290
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   291
SDL_bool
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6653
diff changeset
   292
Android_HasScreenKeyboardSupport(_THIS)
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   293
{
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6653
diff changeset
   294
    return SDL_TRUE;
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   295
}
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   296
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   297
SDL_bool
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   298
Android_IsScreenKeyboardShown(_THIS, SDL_Window * window)
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   299
{
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6653
diff changeset
   300
    return SDL_IsTextInputActive();
6392
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   301
}
fa7eb111f994 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   302
6555
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   303
void
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   304
Android_StartTextInput(_THIS)
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   305
{
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   306
    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   307
    Android_JNI_ShowTextInput(&videodata->textRect);
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   308
}
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   309
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   310
void
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   311
Android_StopTextInput(_THIS)
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   312
{
6654
2ecfb25be1e2 Synchronized the on-screen keyboard state with whether we are accepting text input.
Sam Lantinga <slouken@libsdl.org>
parents: 6653
diff changeset
   313
    Android_JNI_HideTextInput();
6555
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   314
}
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   315
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   316
void
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   317
Android_SetTextInputRect(_THIS, SDL_Rect *rect)
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   318
{
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   319
    SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata;
6808
3ad413bd1cd6 Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6654
diff changeset
   320
3ad413bd1cd6 Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6654
diff changeset
   321
    if (!rect) {
6811
60d95fcfaf3c Update SDL_InvalidParamError to take param name; add additional fuzzer function; add new tests to keyboard test suite; improve surface test suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6808
diff changeset
   322
        SDL_InvalidParamError("rect");
6808
3ad413bd1cd6 Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6654
diff changeset
   323
        return;
3ad413bd1cd6 Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6654
diff changeset
   324
    }
3ad413bd1cd6 Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
Andreas Schiffler <aschiffler@ferzkopp.net>
parents: 6654
diff changeset
   325
    
6555
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   326
    videodata->textRect = *rect;
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   327
}
f2c03c06d987 Fixed bug 1614 - SDL for Android does not implement TextInput API
Sam Lantinga <slouken@libsdl.org>
parents: 6465
diff changeset
   328
6044
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   329
#endif /* SDL_VIDEO_DRIVER_ANDROID */
35448a5ea044 Lots of fixes importing SDL source wholesale into a new iOS project
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   330
4980
d9fdff945ec9 A bit of cleanup in the Android driver
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   331
/* vi: set ts=4 sw=4 expandtab: */